By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,521 Members | 1,460 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,521 IT Pros & Developers. It's quick & easy.

DATE HELP QUICKLY

P: n/a
i have a site that displays shows. i am getting my date from a mysql
function "CURDATE()" but it give me the date one day ahead of the
actual date. i tried $myrow[8] -1 but that doen't work. im sure iknow
what to do but its not hitting the brain right now. and the client
wants a fix asap please help
thanks
Jul 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
xe****@aol.com (todd) wrote in
news:4c**************************@posting.google.c om:
i have a site that displays shows. i am getting my date from a mysql
function "CURDATE()" but it give me the date one day ahead of the
actual date. i tried $myrow[8] -1 but that doen't work. im sure iknow
what to do but its not hitting the brain right now. and the client
wants a fix asap please help
thanks


Set the time correctly on the server?

More to the point, if the time on the server is out by (say) 16 hours
(because of timezone differences or reading time in GMT or something)
you could always modify it by using SELECT SUBDATE(CURDATE(),INTERVAL 16
HOUR) -- which then returns a full timestamp, so SUBDATE(NOW(),...) may
be more accurate...

Of course, if all you want is to subtract 1 day,
SUBDATE(CURDATE(),INTERVAL 1 DAY) will do it.

Pete.
Jul 16 '05 #2

P: n/a
Peter Jones <jo*****@optushome.com.au> wrote in message news:<Xn*****************************@210.49.20.25 4>...
xe****@aol.com (todd) wrote in
news:4c**************************@posting.google.c om:
i have a site that displays shows. i am getting my date from a mysql
function "CURDATE()" but it give me the date one day ahead of the
actual date. i tried $myrow[8] -1 but that doen't work. im sure iknow
what to do but its not hitting the brain right now. and the client
wants a fix asap please help
thanks


Set the time correctly on the server?

More to the point, if the time on the server is out by (say) 16 hours
(because of timezone differences or reading time in GMT or something)
you could always modify it by using SELECT SUBDATE(CURDATE(),INTERVAL 16
HOUR) -- which then returns a full timestamp, so SUBDATE(NOW(),...) may
be more accurate...

Of course, if all you want is to subtract 1 day,
SUBDATE(CURDATE(),INTERVAL 1 DAY) will do it.

Pete.


you are an absoulte life saver THANKS!!!
Jul 16 '05 #3

P: n/a
xe****@aol.com (todd) wrote in
news:4c**************************@posting.google.c om:
you are an absoulte life saver THANKS!!!


No problem,
Pete.
Jul 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.