Welcome to WebmasterWorld Guest from 54.234.63.187

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Quick question about time()

     

capulet_x

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

5+ Year Member



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

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

WebmasterWorld Senior Member 10+ Year Member



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

capulet_x

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

5+ Year Member



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

$five_mins_ago = $currenttime - 300;

capulet_x

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

5+ Year Member



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

Featured Threads

Hot Threads This Week

Hot Threads This Month