iso8601

Parsing an ISO8601 date/time (including TimeZone) in Excel

狂风中的少年 提交于 2019-11-26 06:20:39
问题 I need to parse an ISO8601 date/time format with an included timezone (from an external source) in Excel/VBA, to a normal Excel Date. As far as I can tell, Excel XP (which is what we\'re using) doesn\'t have a routine for that built-in, so I guess I\'m looking at a custom VBA function for the parsing. ISO8601 datetimes look like one of these: 2011-01-01 2011-01-01T12:00:00Z 2011-01-01T12:00:00+05:00 2011-01-01T12:00:00-05:00 2011-01-01T12:00:00.05381+05:00 回答1: There is a (reasonably) simple

How do I get an ISO 8601 date on iOS?

喜你入骨 提交于 2019-11-26 06:05:20
问题 It\'s easy enough to get the ISO 8601 date string (for example, 2004-02-12T15:19:21+00:00 ) in PHP via date(\'c\') , but how does one get it in Objective-C (iPhone)? Is there a similarly short way to do it? Here\'s the long way I found to do it: NSDateFormatter* dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; dateFormatter.dateFormat = @\"yyyy-MM-dd\'T\'HH:mm:ssZ\"; NSDate *now = [NSDate date]; NSString *formattedDateString = [dateFormatter stringFromDate:now]; NSLog(@\"ISO-8601

Java 8 Date and Time: parse ISO 8601 string without colon in offset [duplicate]

梦想与她 提交于 2019-11-26 04:52:17
问题 This question already has an answer here : Cannot parse String in ISO 8601 format, lacking colon in offset, to Java 8 Date (1 answer) Closed last year . We try to parse the following ISO 8601 DateTime String with timezone offset: final String input = \"2022-03-17T23:00:00.000+0000\"; OffsetDateTime.parse(input); LocalDateTime.parse(input, DateTimeFormatter.ISO_OFFSET_DATE_TIME); Both approaches fail (which makes sense as OffsetDateTime also use the DateTimeFormatter.ISO_OFFSET_DATE_TIME )

Java SimpleDateFormat for time zone with a colon separator?

佐手、 提交于 2019-11-26 03:09:08
问题 I have a date in the following format: 2010-03-01T00:00:00-08:00 I have thrown the following SimpleDateFormats at it to parse it: private static final SimpleDateFormat[] FORMATS = { new SimpleDateFormat(\"yyyy-MM-dd\'T\'HH:mm:ssZ\"), //ISO8601 long RFC822 zone new SimpleDateFormat(\"yyyy-MM-dd\'T\'HH:mm:ssz\"), //ISO8601 long long form zone new SimpleDateFormat(\"yyyy-MM-dd\'T\'HH:mm:ss\"), //ignore timezone new SimpleDateFormat(\"yyyyMMddHHmmssZ\"), //ISO8601 short new SimpleDateFormat(\

Parsing ISO 8601 date format like 2015-06-27T13:16:37.363Z in Java [duplicate]

痞子三分冷 提交于 2019-11-26 02:02:29
问题 This question already has answers here : Java / convert ISO-8601 (2010-12-16T13:33:50.513852Z) to Date object (4 answers) Closed 2 years ago . I am trying to parse a String using SimpleDateFormat . This is my current code: public String getCreatedDateTime() { SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-ddEHH:mm:ss.zzzz\"); try { Date date = simpleDateFormat.parse(\"2015-06-27T13:16:37.363Z\"); return date.toString(); } catch (ParseException e) { return \"Error parsing

ISO 8601 String to Date/Time object in Android

孤街醉人 提交于 2019-11-26 01:59:32
问题 I have a string in standard ISO 8601 format that contains the date/time returned from a web service like so: String dtStart = \"2010-10-15T09:27:37Z\" How do I get this into an object such as Time or Date? I initially want to output it in a different format, but will need to do other stuff with it later (i.e. maybe use in a different format). Cheers 回答1: String dtStart = "2010-10-15T09:27:37Z"; SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); try { Date date =

Parsing ISO 8601 date in Javascript

三世轮回 提交于 2019-11-26 01:00:31
问题 Need help/tips on converting an ISO 8601 date with the following structure into javascript. CCYY-MM-DDThh:mm:ssTZD I\'d like to format the date like so: January 28, 2011 - 7:30PM EST I\'d like to keep this solution as clean and minimal as possible. 回答1: datejs could parse following, you might want to try out. Date.parse('1997-07-16T19:20:15') // ISO 8601 Formats Date.parse('1997-07-16T19:20:30+01:00') // ISO 8601 with Timezone offset Edit: Regex version x = "2011-01-28T19:30:00EST" MM = [

Is there a simple way of converting an ISO8601 timestamp to a formatted NSDate?

那年仲夏 提交于 2019-11-26 00:59:23
问题 If I use the following code: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@\"yyyy-MM-dd\'T\'HH:mm\"]; NSDate *myDate = [dateFormatter dateFromString:@\"2010-01-28T15:22:23.863\"]; NSLog(@\"%@\", [dateFormatter stringFromDate:myDate]); It is successfully converted to a Date object, however, I cannot seem to format it any other way than yyyy-MM-dd\'T\'HH:mm , i.e. what gets logged is 2010-01-28T15:22:23 If I change the dateFormat to say

How do I output an ISO 8601 formatted string in JavaScript?

。_饼干妹妹 提交于 2019-11-25 23:16:06
问题 I have a Date object. How do I render the title portion of the following snippet? <abbr title=\"2010-04-02T14:12:07\">A couple days ago</abbr> I have the \"relative time in words\" portion from another library. I\'ve tried the following: function isoDate(msSinceEpoch) { var d = new Date(msSinceEpoch); return d.getUTCFullYear() + \'-\' + (d.getUTCMonth() + 1) + \'-\' + d.getUTCDate() + \'T\' + d.getUTCHours() + \':\' + d.getUTCMinutes() + \':\' + d.getUTCSeconds(); } But that gives me: \"2010

Given a DateTime object, how do I get an ISO 8601 date in string format?

廉价感情. 提交于 2019-11-25 23:01:21
问题 Given: DateTime.UtcNow How do I get a string which represents the same value in an ISO 8601-compliant format? Note that ISO 8601 defines a number of similar formats. The specific format I am looking for is: yyyy-MM-ddTHH:mm:ssZ 回答1: Note to readers: Several commenters have pointed out some problems in this answer (related particularly to the first suggestion). Refer to the comments section for more information. DateTime.UtcNow.ToString("yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz"); This gives you a