-1

I have this date for timestamp like 1393516517, but I need the timestamp for 60 days.

I tried this way:

( 24 * 60 * 60 ) * 60 = 5184000;

Is this the correct way to do it?

Amal Murali
  • 75,622
  • 18
  • 128
  • 150
user3329175
  • 3
  • 1
  • 3
  • 1
    What does `i need the timestamp for 60 days.` mean? Do you need a timestamp for 60 days from now? – John Conde Feb 27 '14 at 16:21
  • What do you mean by "*the timestamp for 60 days*"? (In any case, you're probably looking for http://php.net/strtotime) – Amal Murali Feb 27 '14 at 16:21
  • 1
    24*60*60*60 is indeed equal to 5184000. That is correct. It's probably not what you want to know, but it is the answer to the question you're asking. – Tularis Feb 27 '14 at 16:24
  • *(related)* [Why do we use strtotime() in PHP?](http://stackoverflow.com/questions/20822821/why-do-we-use-strtotime-in-php) – Amal Murali Feb 27 '14 at 16:29

2 Answers2

4

1393516517 is called a UNIX timestamp and is the number of seconds since the Unix Epoch (January 1, 1970 00:00:00 GMT). This timestamp in particular corresponds to 02/27/2014 3:55 PM GMT.

If you want to add 60 days to a UNIX timestamp, then you do indeed need to add the number of seconds 60 days equals just as you do. So 1393516517 + 5184000 = 1398700517 which is 04/28/2014 3:55 PM GMT.

kba
  • 19,333
  • 5
  • 62
  • 89
3

Assuming you are trying to get a Unix timeatamp for a date 60 days into the future of your start date:

$date = new DateTime('@1393516517');
$date->modify('+60 days');
echo $date->format('U');
John Conde
  • 217,595
  • 99
  • 455
  • 496