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

zeckdude picture zeckdude · Mar 25, 2010 · Viewed 258.3k times · Source

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?

Answer

Álvaro González picture Álvaro González · Mar 25, 2010

You probably want to add one day rather than 24 hours. Not all days have 24 hours due to (among other circumstances) daylight saving time:

strtotime('+1 day', $timestamp);