KBD

Keith Devens .com

Friday, March 19, 2010 Flag waving
"For a while he didn't think it was possible. Then, once he got over that..." – GameSpy on Will Wright's "Spore" video game
← DataVisionRSS auto-discovery with PHP →

Daily link icon Monday, June 3, 2002

ISO 8601 date/times

PHP's strtotime function doesn't read full ISO 8601 date/times??

← DataVisionRSS auto-discovery with PHP →

Comments XML gif

KC wrote:

GAH I KNOW.

I have been scouring google for a function that will let me do this.

I'm about to give up and write my own.

∴ KC | 30-Jul-2004 2:02am est | #5147

Keith (http://keithdevens.com/) wrote:

Actually, you can still use php's strtotime function. Just to a str_replace and replace the 'T' in the middle with a space and then parse it with strtotime.

Keith | 30-Jul-2004 2:16am est | http://keithdevens.com/ | #5148

Jacob wrote:

strtotime will fail if the iso date contains a time zone offset (+01:00 or Z at the end of the string), sure these can be removed with a "substr" but then the time will be off... this can be corrected by parsing those last 5 characters, but already it seems as simple and more reliable to write your own parser. Anyone? ...

∴ Jacob | 30-Nov-2006 7:32am est | #9802

Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

March 2010
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
28293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 2 posts

Recent comments XML

I hate ASP.NET

I hate ASP... I was doing wonders​with PHP, then suddenly one of my​clients...

Johnies: Mar 17, 6:14am

Quantum physics and free will

I knew you were going to say that....

Tom Massey: Mar 15, 9:26pm

Generated in about 0.111s.

(Used 8 db queries)