converting seconds since unix epoc to date array
| From: | Jason FB | Date: | Tue, 07 Sep 2004 03:59:54 +0000 |
| Subject: | converting seconds since unix epoc to date array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-196011@lists.php.net to get a copy of this message | ||
Can anyone tell me how to convert a date stored in the format "YYYY-MM-DD" to an integer of seconds since unix epoc,
then add $daysToAdd days to this value (I suppose if the integer was a number of seconds it would have to be $daysToAdd*60*60*24 to get the number of seconds to add)
then convert the new value to a timestamp which I can output using the function
string date ( string format [, int timestamp])
I tried doing this with mktime() and couple different ways using strtotime() and also with strftime() but I kept getting -1 as the result for strtotime() indicating the function couldn't interpret the given date.
I've been through all the date-related functions in the manual I can think of, but I'm stumpped on this one...