Re: newbie date time question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/22/2011 06:54 PM, David Nicholls wrote:
>> I'm late to the party, but strtotime works great, though you need to
>> give it what it expects:
>>
>> $ts = strtotime(str_replace('/', '-', $date));
>>
> 
> Thanks, Shawn, that's a bit more elegant!  I'll give it a go. I didn't
> know how to do the str_relace bit.  Thanks

The deal is that if you use the / then strtotime interprets it as m/d/y
and if you use - it interprets it as d-m-y.

-- 
Thanks!
-Shawn
http://www.spidean.com

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux