Re: php or juvascript convert IETF format to ISO08601
| From: | Simon J Welsh | Date: | Tue, 15 Mar 2011 09:39:52 +0000 |
| Subject: | Re: php or juvascript convert IETF format to ISO08601 | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-311857@lists.php.net to get a copy of this message | ||
On 15/03/2011, at 9:18 PM, Joce Jovanov wrote:
> On Tue, Mar 15, 2011 at 12:44 AM, Simon J Welsh <simon@welsh.co.nz> wrote:
>
>> On 15/03/2011, at 12:32 PM, Jordan wrote:
>>
>>> Hello Evrybody,
>>>
>>> Can i convert IETF format (ex: "Wed, 18 Oct 2009 13:00:00 EST") in
>> ISO8601 format (ex: "2009-11-05T13:15:30Z")
>>>
>>> Does somebody know some php scripte or similar?
>>>
>>> Thanks...
>>
>> strtotime() (http://php.net/strtotime) and date() (http://php.net/date).
>> There's even a DATE_ISO8601 constant for the correct date format.
>>
>> ---
>> Simon Welsh
>> Admin of http://simon.geek.nz/
>>
>> Who said Microsoft never created a bug-free program? The blue screen never,
>> ever crashes!
>>
>> http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e
>>
>>
> Hi again,
> Thanks for the email,
> do you alredy know some function who will convert IETF format to ISO8601
You'd use the strtotime function to convert the IETF format to a timestamp, then then date
function to convert that timestamp to ISO8601.
Something like date(DATE_ISO8601, strtotime('IETF format string')).
---
Simon Welsh
Admin of http://simon.geek.nz/
Who said Microsoft never created a bug-free program? The blue screen never, ever crashes!
http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e