ISO 8601 is the International Standards Organization's standard for representing time as a string. It covers dates, times, timezones, durations, and many other things.
Questions tagged [iso8601]
911 questions
30
votes
3 answers
Alternative to colon in a time format
ISO 8601 recommends the following format for a date and time:
2014-12-29T16:11:20+00:00
I'm rather fond of this format since it allows for lexical ordering. But there is a small problem: some file systems don't allow colons in file names (at least…

jpmc26
- 28,463
- 14
- 94
- 146
28
votes
2 answers
Is there a full implementation for ISO-8601 date parsing for Ruby?
The Time.iso8601 method is a restricted subset of ISO-8601.
What are its limitations?
Does anyone know of a full implementation for Ruby? I'm using MRI 1.8.7.
Update
It looks like there isn't a single class that handles all of the various 8601…

Chris McCauley
- 25,824
- 8
- 48
- 65
27
votes
2 answers
c# convert datetime object to iso 8601 string
I'm trying to convert a DateTime object to a ISO8601 string but keep getting wrong results. I've looked around on stackoverflow, but couldn't find the right solution.
I start with a date time string of "2017-06-26T20:45:00.070Z" which deserialized…

user1161137
- 1,067
- 1
- 11
- 31
26
votes
1 answer
Timestamps: iso8601 vs unix timestamp
I know this is a pretty common question, but I don't feel like the answers I found really solve the problem. I will outline my specific use case and present summaries to the information from other SO answers and around the web.
For the service I'm…

qingu
- 2,101
- 2
- 16
- 20
25
votes
3 answers
Cannot parse String in ISO 8601 format, lacking colon in offset, to Java 8 Date
I'm a little bit frustrated of java 8 date format/parse functionality. I was trying to find Jackson configuration and DateTimeFormatter to parse "2018-02-13T10:20:12.120+0000" string to any Java 8 date, and didn't find it.
This is java.util.Date…

Ivan
- 253
- 3
- 4
25
votes
3 answers
How to get JSON.NET to serialize date/time to ISO 8601?
I have a Web API application that returns JSON to consumers who may not be using Microsoft technologies. When my controller returns an object with DateTime properties as JSON, it serializes the date in this format:
2017-03-15T00:00:00-04:00
This is…

oscilatingcretin
- 10,457
- 39
- 119
- 206
25
votes
3 answers
Combined date and time representation in Bash
How can I obtain current date in the following format using Bash
YYYY-MM-DDThh:mm:ss

Misha Slyusarev
- 1,353
- 2
- 18
- 45
24
votes
3 answers
How do I convert a SystemTime to ISO 8601 in Rust?
I have a SystemTime variable and I want to get the ISO 8601 format from that date.

Mathe Eliel
- 658
- 2
- 6
- 16
24
votes
4 answers
ISO 8601 Duration with milliseconds?
How should a duration of 500 milliseconds be expressed using ISO 8601? To me, the documentation is not 100% clear. Is it just "PT0.5S" ?

Werner
- 1,229
- 1
- 10
- 24
23
votes
6 answers
Validate ISO 8601 date string
How do you validate ISO 8601 date string (ex: 2011-10-02T23:25:42Z).
I know that there are several possible representations of ISO 8601 dates, but I'm only interested in validating the format I gave as an example above.

titel
- 3,454
- 9
- 45
- 54
22
votes
1 answer
Python logger output dates in IS8601 format
Is there a way to make the Python logger output dates in ISO8601 format?
My logger is set up like this...
logging.basicConfig(
format="%(message)s - %(asctime)s)
From the Python docs (located here: https://docs.python.org/2/howto/logging.html)…

Remotec
- 10,304
- 25
- 105
- 147
22
votes
2 answers
DateTime ISO 8601 without timezone component
I've been doing work with parsing datetime strings for our international application. I'm running into an interpretation issue that I can't seem to find a definitive answer. Should an ISO 8601 datetime string without a timezone component be…

Devin
- 1,014
- 1
- 9
- 28
20
votes
2 answers
How can I convert a date value in ISO 8601 format to a date object in JavaScript?
I've been trying to convert a date value into a more readable format. To do that, I'm trying to parse the date using the JavaScript Date.parse() method. That however does not work on the input (eg: "2007-09-21T14:15:34.058-07:00") that I have. The…

midas06
- 1,991
- 2
- 22
- 43
19
votes
7 answers
How do I convert an ISO 8601 string to a Delphi TDate?
I can convert a Delphi TDate to ISO 8601 format easily using this:
DateTimeToString(result, 'yyyy-mm-dd', myDate);
What's the idiomatic way to do the inverse conversion? StringToDateTime() doesn't seem to exist.
Obviously I can do it the "hard" way…

Roddy
- 66,617
- 42
- 165
- 277
19
votes
1 answer
Unix timestamp to iso 8601 time format
When I convert unix time 1463288494 to isoformat i get 2016-05-14T22:01:34. How can I get the output including the -07:00. In this format 2016-05-14T22:01:34-07:00
from datetime import datetime
t = …

kotlavaibhav
- 199
- 1
- 2
- 8