Alex Rivera | Logout

How do I add 24 hours to a unix timestamp in php?

Asked 2010-03-25T11:37:16.450
141

I would like to add 24 hours to the timestamp for now. How do I find the unix timestamp number for 24 hours so I can add it to the timestamp for right now?

I also would like to know how to add 48 hours or multiple days to the current timestamp.

How can I go best about doing this?

Edit
Report

1 Answer

109

A Unix timestamp is simply the number of seconds since January the first 1970, so to add 24 hours to a Unix timestamp we just add the number of seconds in 24 hours. (24 * 60 *60)

time() + 24*60*60;
answered 2010-03-25T11:39:14.263

Your Answer