iso8601

How can I write an ISO 8601 date with a timezone but no time component

感情迁移 提交于 2021-02-06 12:56:05
问题 An ISO 8601 datetime with a timezone is formatted like this: 2018-09-07T05:28:42Z However, I need to represent some dates in my system where the precision is days, not seconds, which means that it would be an ISO 8601 calendar date. Calendar dates are formatted like this: 2018-09-07 In the Wikipedia article about the standard (I don't have access to the standard itself, as you have to pay for that privilege), there is no mention of timezone when discussing dates. It does talk about omitting

How to get week number and year from date in R

自闭症网瘾萝莉.ら 提交于 2021-02-04 19:47:18
问题 I am trying to get both week number and year from a date object in R. Until then, I did it separately : I used isoweek() function to extract week and year() function to extract year. So that my data.frame has 3 variables : date, week, year This is working except for beginning/end of year : for example, 2015 has 53 weeks and January 1st, 2016 belongs to the 53rd week of 2015 ... but with my code, it is such that 1/1/2016 is week 53 but year 2016 whereas I would like it to be week 53 in year

How to get week number and year from date in R

微笑、不失礼 提交于 2021-02-04 19:47:05
问题 I am trying to get both week number and year from a date object in R. Until then, I did it separately : I used isoweek() function to extract week and year() function to extract year. So that my data.frame has 3 variables : date, week, year This is working except for beginning/end of year : for example, 2015 has 53 weeks and January 1st, 2016 belongs to the 53rd week of 2015 ... but with my code, it is such that 1/1/2016 is week 53 but year 2016 whereas I would like it to be week 53 in year

How to add “updatedAt” timestamp to elasticsearch documents

情到浓时终转凉″ 提交于 2021-01-28 08:29:49
问题 I want to ensure that all documents of a certain doc_type have a "updatedAt" timestamp (ISO 8601) that gets updated whenever the document is updated. It needs to be a server-side timestamp as I don't know if I can trust that all of the clients times are in sync. I use an ingest pipeline to add "createdAt" timestamps, but it seems that pipelines are not supported using the update API. I've tried using update scripts (using the newly available 'ctx._now' value), but cannot get the parsing into

Timestamp in ISO 8601 - the last 6 digits yyyy-MM-dd'T'HH:mm:ss.?

喜夏-厌秋 提交于 2021-01-02 07:55:50
问题 I have timestamps looking like this: 2015-03-21T11:08:14.859831 2015-03-21T11:07:22.956087 I read a Wiki article on ISO 8601, but did not get the meaning of the last 6 digits here. I tried getting it down to milliseconds using "yyyy-MM-dd'T'HH:mm:ss.sss" or "yyyy-MM-dd'T'HH:mm:ss.ssssss" . Is it just more precise than milliseconds - up to microseconds? 回答1: Is it just more precise than milliseconds? Yes, it's microseconds in this case. ISO-8601 doesn't actually specify a maximum precision. It

DateFormatter/ISO8601DateFormatter can not get date from string [duplicate]

非 Y 不嫁゛ 提交于 2020-12-13 04:51:30
问题 This question already has answers here : Instantiated optional variable shows as nil in Xcode debugger (2 answers) Closed 9 months ago . How to use ISO8601DateFormatter to convert a String to Date? let iSO8601DateFormatter = ISO8601DateFormatter() let string = iSO8601DateFormatter.string(from: Date()) //2019-12-04T08:23:27Z let date = iSO8601DateFormatter.date(from: string) //nil ? The code above run in iPhone8 simulator with Xcode 11.2.1, I get nil. But it works in the Playground of same

Can ISO 8601 represent a date such as “Summer 2011”?

本秂侑毒 提交于 2020-12-12 07:05:30
问题 Can ISO 8601 represent a date such as "Summer 2011"? The closest I can think of is "2011-07" or fallback to "2011". Of course if you are allowed to make use of time intervals you could use "2011-06-01/2011-08-31", but I am interested in possibilities that can be used in Wikidata and I don't thing the time interval solution can be used there. 来源: https://stackoverflow.com/questions/42468714/can-iso-8601-represent-a-date-such-as-summer-2011

java.time.ZonedDateTime.parse and iso8601?

心已入冬 提交于 2020-08-24 06:30:14
问题 Why does the JDK8 DateTime library seem to not parse valid iso8601 date time strings? It chokes on time zone offsets expressed like "+01" instead of "+01:00" This works: java.time.ZonedDateTime.parse("2015-08-18T00:00+01:00") This throws a parse exception: java.time.ZonedDateTime.parse("2015-08-18T00:00+01") From the iso8601 wikipedia page: The offset from UTC is appended to the time in the same way that 'Z' was above, in the form ±[hh]:[mm], ±[hh][mm], or ±[hh]. So if the time being

Swift ISO8601 format to Date

陌路散爱 提交于 2020-08-19 12:19:50
问题 I have the following string: 20180207T124600Z How can I turn this into a Date object? Here is my current code but it returns nil : let dateString = "20180207T124600Z" let dateFormatter = ISO8601DateFormatter() dateFormatter.formatOptions = .withFullTime print(dateFormatter.date(from: dateString)) 回答1: You can specify ISO8601 date formate to the NSDateFormatter to get Date: let dateFormatter = DateFormatter() dateFormatter.dateFormat = "yyyyMMdd'T'HHmmssZ" print(dateFormatter.date(from: