iso8601

Identifying time zones in ISO 8601

柔情痞子 提交于 2019-11-30 17:14:25
No, I'm not talking about zone offsets --- those can vary during the year for a region based on e.g. DST. I'm talking about the actual time zones maintained by IANA . I understand these are not supported by ISO 8601, correct? What are platforms doing to support identifying time zones in ISO 8601-like string representations? I notice that the latest Java date/time library is using an extended ISO 8601 format for this, e.g. 2011-12-03T10:15:30+01:00[Europe/Paris] . (See DateTimeFormatter API .) Is there some converging convention (e.g. with other languages and platforms) for extending ISO 8601

ECMAScript 5 Date.parse results for ISO 8601 test cases

天大地大妈咪最大 提交于 2019-11-30 15:44:07
What result is right for the following test cases? //Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1 console.log(Date.parse("2012-11-31T23:59:59.000Z"));//1354406399000 NaN NaN 1354406399000 NaN console.log(Date.parse("2012-12-31T23:59:59.000Z"));//1356998399000 1356998399000 1356998399000 1356998399000 1356998399000 console.log(Date.parse("2012-12-31T23:59:60.000Z"));//NaN NaN NaN NaN 1356998400000 console.log(Date.parse("2012-04-04T05:02:02.170Z"));//1333515722170 1333515722170 1333515722170 1333515722170 1333515722170 console.log(Date.parse("2012-04-04T24:00:00.000Z"));//NaN 1333584000000

PHP: How to convert string duration to ISO 8601 duration format? (ie. “30 minutes” to “PT30M”)

霸气de小男生 提交于 2019-11-30 13:12:31
There are plenty of questions asking how to do this the other way (converting from this format), but I cant find anything on how to output in the ISO 8601 duration format in PHP. So I have a heap of duration strings in human readable format - I want to convert them into the ISO 8601 format on the fly to print the durations for HTML5 microdata. Below is a sample of some of the strings coming in, and how they should be formatted "1 hour 30 minutes" --> PT1H30M "5 minutes" --> PT5M "2 hours" --> PT2H You get the idea. I can push the string into an interval object in PHP: date_interval_create_from

Parse and create ISO 8601 Date and time intervals, like PT15M in PHP

不问归期 提交于 2019-11-30 06:20:54
A library and webservice I am using communicates time-intervals in ISO 8601 format: PnYnMnDTnHnMnS . I want to convert such formats to seconds. And vice versa. Seconds are a lot easier to calculate with. Example interval values are: PT1M or PT60S (1 minute) PT1H, PT60M or PT3600S (1 hour) I need two functions: parse from such values to seconds: iso8601_interval_to_seconds() and from seconds into such intervals: iso8601_interval_from_seconds() . The latter is rather simple, because it could be done as `"PT{$seconds}S", just pass seconds along, at all times. Maybe this can be done nicer with a

What's the right way to parse an ISO8601 date in cocoa?

久未见 提交于 2019-11-30 05:20:10
I would like to parse ISO8601 dates in Cocoa, both for iOS 4+ and OSX 10.6+ There are a few questions about this on StackOverflow already, but in my opinion none of them contain good answers. Here's what I think constitutes a good answer: The answer should point to code with support for ISO8601. This code should compile cleanly under XCode 4 for both iOS 4+ and OSX 10.6+. The code should support all possible ISO8601 date formats. Please note that there are many, many possibilities here. Simply answering with one or two format strings for NSDateFormatter is not going to cut it. The answer

ISO 8601 date-time format combining 'Z' and offset of '+0000'

隐身守侯 提交于 2019-11-29 23:39:55
问题 I'm playing with date-time format from ISO 8601. I have this pattern: "yyyy-MM-dd'T'HH:mm:ssZZ'Z'" and the output is: "2015-11-17T00:00:00+0000Z" . My question is if the output is ok, if is possible to have in a date +0000 and Z taking in account both has the same meaning time zone offset/id. Thanks in advance for clarification =) 回答1: No, not OK No, the Z is an offset-from-UTC so it should not be combined redundantly with a numerical offset of +00:00 or +0000 . ISO 8601 While I do not have

PHP: How to convert string duration to ISO 8601 duration format? (ie. “30 minutes” to “PT30M”)

亡梦爱人 提交于 2019-11-29 18:06:43
问题 There are plenty of questions asking how to do this the other way (converting from this format), but I cant find anything on how to output in the ISO 8601 duration format in PHP. So I have a heap of duration strings in human readable format - I want to convert them into the ISO 8601 format on the fly to print the durations for HTML5 microdata. Below is a sample of some of the strings coming in, and how they should be formatted "1 hour 30 minutes" --> PT1H30M "5 minutes" --> PT5M "2 hours" -->

Identifying time zones in ISO 8601

这一生的挚爱 提交于 2019-11-29 16:47:55
问题 No, I'm not talking about zone offsets --- those can vary during the year for a region based on e.g. DST. I'm talking about the actual time zones maintained by IANA. I understand these are not supported by ISO 8601, correct? What are platforms doing to support identifying time zones in ISO 8601-like string representations? I notice that the latest Java date/time library is using an extended ISO 8601 format for this, e.g. 2011-12-03T10:15:30+01:00[Europe/Paris] . (See DateTimeFormatter API.)

How to bind ISO8601 TSQL DATETIME parameter with PDO?

半腔热情 提交于 2019-11-29 14:43:39
It seems that PDO has a problem with ISO 8601 formatted timestamps. I'm connecting from 64-bit Ubuntu 16.04 running PHP 7.0.8 using the Microsoft® ODBC Driver 13 (Preview) for SQL Server® Here's my simple table: CREATE TABLE dtest ( "stamp" DATETIME ); Works: $pdoDB = new PDO('odbc:Driver=ODBC Driver 13 for SQL Server; Server='.DATABASE_SERVER.'; Database='.DATABASE_NAME, DATABASE_USERNAME, DATABASE_PASSWORD ); $pdoDB->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); $sql = "INSERT INTO dtest (stamp) VALUES ('2011-03-15T10:23:01')"; $stmt = $pdoDB->prepare($sql); $params = []; $stmt-

Parsing ISO 8601 with NSDateFormatter

痞子三分冷 提交于 2019-11-29 12:48:56
I've read through the various posts on SO about this, but have still not solved the problem. Here's the string that I'm trying to parse into an NSDate object: 2012-04-08T12:00:00.00+02:00 I understand that the problem is the time zone format. Here's the date format string that I'm trying: yyyy-MM-dd'T'HH:mm:SSZZZZ Thanks for any help. Three things: Use the -[NSDateFormatter getObjectValue:forString:range:error:] method to learn how much of the string was parsed and what error prevented parsing further. The ZZZZ format string corresponds to something like "GMT+02:00", with that "GMT" in there.