2

I'm looking into using ISO 8601 for using date in my applications but I can't get my head around how to use timezone descriptors. Is there any way to use a location specific timezone string (e.g.: FR for 'Europe/Paris') instead of +01:00?

What I'd like is:

2017-10-12T14:12:50FR

Instead of

2017-10-12T14:12:50+01:00

Is this valid ISO 8601 or am I understanding this wrong?

Titulum
  • 9,928
  • 11
  • 41
  • 79
  • 2
    "2017-10-12T14:12:50FR" certainly isn't a valid ISO-8601 representation, no. Even aside from the made-up time zone ID, ISO-8601 never actually represents a time zone - only a UTC offset. (Unfortunately it *calls* that offset a "zone designator", which is just sloppy IMO. But it really *doesn't* represent a time zone.) – Jon Skeet Oct 12 '17 at 12:20
  • Is there any standardized way of using a datetime notation that inclides timezones? – Titulum Oct 12 '17 at 12:53
  • 2
    I don't know of any standard. I'd recommend specifying the date/time with a UTC offset, and the time zone ID separately. Just the date/time and time zone ID without the offset isn't always enough to uniquely represent an instant in time, due to DST changes - e.g. 1:30am will happen twice if the clocks "fall back" at 2am. – Jon Skeet Oct 12 '17 at 13:28

0 Answers0