Page 1 of 1
datetime convertion
Posted: Wed Sep 20, 2006 8:16 pm
by kahwooi
How to convert RFC 3399 '2006-09-21T08:10:00-08:00' to normal datetime 20006-09-21 08:10:00?
Thank you.
Posted: Wed Sep 20, 2006 9:44 pm
by neophyte
Posted: Wed Sep 20, 2006 10:05 pm
by kahwooi
Yah I did try, but wrong result.
Re: datetime convertion
Posted: Wed Sep 20, 2006 10:07 pm
by n00b Saibot
kahwooi wrote:to normal datetime 20006-09-21 08:10:00?
you call that normal?
what do you mean by wrong result?
Posted: Thu Sep 21, 2006 12:18 am
by RobertGonzalez
kahwooi wrote:Yah I did try, but wrong result.
What result did you get? And how are you getting that date in the first place?
Posted: Thu Sep 21, 2006 12:41 am
by kahwooi
$strtotime = strtotime('2006-09-21T08:10:00-08:00');
echo date('H:i:s', $strtotime);
I think I'm not right. Please Help!
Posted: Thu Sep 21, 2006 2:59 am
by onion2k
If your date is definitely going to be in RFC 3399 format, just use a regular expression to break it down and then feed the elements into mktime(). I doubt strtotime() knows how to handle RFC 3399 format.
Posted: Thu Sep 21, 2006 4:38 am
by volka
Can't find a rfc 3399 at
http://www.rfc-editor.org/rfc-index.html
3398 Integrated Services Digital Network (ISDN) User Part (ISUP) to Session Initiation Protocol (SIP) Mapping G. Camarillo, A. B. Roach, J. Peterson, L. Ong [ December 2002 ] ( TXT = 166197 bytes)
3400 Not Issued [ ] ( TXT = 29 bytes)
Posted: Thu Sep 21, 2006 3:50 pm
by feyd
It's ISO 8601 format.
See date().