views:

186

answers:

3

Hello,

just a quick question,

What time corresponds to : time()-24*60*60 ? (PHP)

7 days ? is that right ?

Thanks !

+10  A: 

time 24 hours ago.

time() returns the current Unix timestamp which is number of seconds since the Unix Epoch. Also there are 24 hours in a day and 60 min in an hour and 60 sec in a min.

codaddict
+3  A: 

One day ago actually. You're missing a 7 * if you need 7 days...

Bozhidar Batsov
+7  A: 

time() works with seconds, so:

60 * 60 = 3600 seconds (1 hour)
24 * 1 hour = 1 day
24 * 60 * 60 = 1 day
Martin Sikora