Hi,

 Try 
$date="YYYY-MM_DD";
$da=explode("-",$date);
Now 

$Y=$da['0'];
$M=$da['1'];
$D=$da['2'];

then  use mktime();

Hope you will get the results.

zareef ahmed 
--- Jason FB <[EMAIL PROTECTED]> wrote:

> 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...


=====
Homepage :: http://www.zasaifi.com


                
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to