homepage Welcome to WebmasterWorld Guest from 54.226.213.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

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

PHP Server Side Scripting Forum

    
Quick question about time()
capulet_x




msg:3331335
 11:28 pm on May 4, 2007 (gmt 0)

What would be the correct way to express five minutes prior to the current time?

time()-(00:05:00);? I know that's completely wrong. How do you express five mins in the UNIX timestamp format?

 

mcavic




msg:3331377
 12:24 am on May 5, 2007 (gmt 0)

Unixtime is the number of seconds since midnight Jan 1, 1970 GMT. So, 5 minutes ago is:
time() - (5 * 60);

capulet_x




msg:3331378
 12:24 am on May 5, 2007 (gmt 0)

Does this seem right if 300 is 5 mins past the UNIX epoch?

$five_mins_ago = $currenttime - 300;

capulet_x




msg:3331379
 12:25 am on May 5, 2007 (gmt 0)

mcavic, I just missed your post. Thanks for your response.

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