Welcome to WebmasterWorld Guest from 54.196.232.162

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Date Manipulation Question

     
6:28 pm on Mar 2, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 30, 2003
posts:57
votes: 0


Hi All,

I am currently using the NOW() variable in MySQL to generate a date that looks something like this:

2005-03-02 18:18:49

My question is, how do I create a time that is 5 hours in the past? The time zone is too far ahead, thanks in advance,

Dave

7:49 pm on Mar 2, 2005 (gmt 0)

New User

10+ Year Member

joined:Feb 8, 2005
posts:13
votes: 0


SELECT DATE_SUB(NOW(), INTERVAL 5 HOUR)

or easier

SELECT NOW() - INTERVAL 5 HOUR

Hope this helps =)