homepage Welcome to WebmasterWorld Guest from 54.227.25.58
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Date Manipulation Question
sysdomatic




msg:1308038
 6:28 pm on Mar 2, 2005 (gmt 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

 

frizhard




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

SELECT DATE_SUB(NOW(), INTERVAL 5 HOUR)

or easier

SELECT NOW() - INTERVAL 5 HOUR

Hope this helps =)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved