dbTalk Databases Forums  

Help date and time function PHP/MySQL

comp.databases comp.databases


Discuss Help date and time function PHP/MySQL in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
rija
 
Posts: n/a

Default Help date and time function PHP/MySQL - 11-21-2006 , 12:14 AM






Hi folks,
I need help regarding date and time comparison in PHP and MySQL
My website is hosted in the USA (GMT - 8)
And It is managed in Madagascar (GMT + 3)
Want to consider DATE in Madagascar not in USA -
MySQL CONVERT_TZ's function doesn't work


So, how can I do the following:
1. Today's visits
$query = "SELECT count(*) FROM visits WHERE now() = date";


2. Articles on the website appear only after 6 AM (GMT +3) compared to
the date_publication
$query = "SELECT n_edition FROM $table WHERE NOW() >
DATE_SUB(date_publication, INTERVAL 16 HOUR) ORDER BY n_edition DESC
LIMIT 1" ;


I don't know how to use DATE_ADD and DATE_SUB regarding the problem
below.
Notes that either visits.date and editions.date is recorded on the
server GMT -8


Any help could be appreciated


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.