KBD

Keith Devens .com

Tuesday, August 19, 2008 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)
:

August 2008
SunMonTueWedThuFriSat
 12
3456789
10111213141516
17181920212223
24252627282930
31 



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

Girls, please don't get breast implants

Wow... I'm almost embarrassed to​admit I'm a member of the female​gender, a...

Proud B-Cup: Aug 16, 2:59am

Spider solitaire

HELLO Keith, 
I did your​impossible game at fourth attempt​with score of 1...

NICOLA-ITA: Aug 14, 3:55am

Generated in about 0.156s.

(Used 8 db queries)

mobile phone