iso-8601

How to display a date as iso 8601 format with PHP

I'm trying to display a datetime from my MySQL database as an iso 8601 formated string with PHP but it's coming out wrong. 17 Oct 2008 is coming out as: 1969-12-31T18:33:28-06:00 which is clearly not correct (the year should be 2008 not 1969) This is the code I'm using: <?= date("c", $post[3]) ?> $post[3] is the datetime (CURRENT_TI...

Select ISO 8601 Timestamp from MySQL Database

Hello, I am currently using PHP/MySQL and the jQuery timeago plugin. Basically, I need to pull my timestamp from the database and convert it to ISO 8601 format. Like this 2008-07-17T09:24:17Z Currently, my timestamps are in the database in this format: 0000-00-00 00:00:00 I have tried using timeago with my currently formatted time...

Convert querstring parameter to javascript date object fails - NaN

I am trying to convert a querystring value into Javascript date object and then converting it into ISO Date format. I have three button - one extracts the querystring and displays the value - works properly Second, uses first function to extract querystring (works) and then converts to Date - fails - get NaN Third, passes a hardcoded st...

Does Javascript/EcmaScript3 support ISO8601 date parsing?

How are you currently parsing ISO8601 dates e.g. 2010-02-23T23:04:48Z in JavaScript? Some browsers return NaN (including Chrome) when using the code below, FF3.6+ works though. <html> <body> <script type="text/javascript"> var d = Date.parse("2010-02-23T23:04:48Z"); document.write(d); </script> </body> </html> You can try this...

C# ISO 8601 Time Interval validation

Dear all, I have searched for a while and can't seem to find anything that's related to this. I need to validate an ISO 8601 time interval. There is loads of stuff about ISO 8601 date times but i specifically need interval. I am using a regex and this is what I have so far; Regex regEx = new Regex(@"^P((\d+)Y)((\d+)M)((\d+)D)(T)((\d...