I know that I need to use the temporary layout in GoLang (as shown here https://golang.org/src/time/format.go ), but I can not find the layout for the ISO 8601 timestamp.
If this helps, I get the timestamp from the Facebook API. Here is an example timestamp:2016-07-25T02:22:33+0000
2016-07-25T02:22:33+0000
I found this layout to work: "2006-01-02T15: 04: 05-0700"
RFC3339 is equivalent to ISO 8601. In particular, it has the same format, RFC3339 has more stringent requirements (for example, it requires a full date representation with a 4-digit year).
ISO 8601 RFC 3339?
, time.RFC3339 .
time.RFC3339
, RFC3339 , "+00: 00" ( "Z" UTC), ISO8601 "+0000".
RFC3339:
[...] time-numoffset = ("+" / "-") time-hour ":" time-minute time-offset = "Z" / time-numoffset [...] full-time = partial-time time-offset date-time = full-date "T" full-time
, time.RFC3339
"2006-01-02T15:04:05Z07:00"
:
"2006-01-02T15:04:05Z0700"
, Cocoa Swift 4 Date JSON .iso8601:
Date
.iso8601
let encoder = JSONEncoder() encoder.dateEncodingStrategy = .iso8601 if let encodedData = try? encoder.encode(myStruct) { ... }
Go :
2006-01-02T15:04:05.99999Z07:00
Source: https://habr.com/ru/post/1649192/More articles:Tetris 2d array logic - javascriptVisual Studio C # - SQLite.Interop.dll Not Found - c #Rewrite the ASP.Net MVC homepage to a different IP address - asp.netAttach list items with a "+" in a string - pythonОшибка Rails ActionCable во время рукопожатия websocket - ruby-on-railsLua Why is “required” unsafe for use in a sandbox environment? - luaAngularJS - capturing multiple JSON key values and then combining them - jsonDetect arbitrary string character set / script - utf-8не удалось загрузить dll sqlite interop dll WPF - c#How to quickly make the transition to viewing using the fragment? - androidAll Articles