I am looking for an online tool that checks if a string is ISO8601 compliant. I am not just interested in the timestamp part, but also durations. So all of these should be considered valid:


Preferably it should cover the complete ISO8601-standard.


This isn't exactly what you're after but feel free to modify as needed (I just whipped it up).


If you enter a date string in the input field in the bottom right box and press Test it will attempt to validate your date.

Valid Dates should pass and indicate such, but invalid dates like:


should fail because there is no 13th month.

It will split your incomming string by / characters to enable a range of dates.


However it will not pass P1Y2M10DT2H30M as a valid date (I was not aware at the time I wrote this that this format was valid)

  • Read the standard or at the very least the Wikipedia page if you have any doubt whether a string is valid ISO8601.
    – Ole Tange
    Jun 3 '15 at 21:57
  • @OleTange in the last 10 years that I've used ISO8601 dates I haven't once used ranges so I apologize for not realizing there was a syntax for them. If the tool I created above is helpful for you I can certainly improve it to handle the date ranges.
    – scunliffe
    Jun 4 '15 at 11:29
  • 2
    FYI, the P1Y2M10DT2H30M value is not a date, it is a period or duration (terms are not standardized). A period/duration is a span of time not tied to the timeline. For example, in the US lunchtime is PT30M while in France it is PT2H. A good date-time library like Joda-Time can add or subtract the period/duration to a specific date-time value tied to the timeline. Jun 26 '15 at 2:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.