I assume this should be pretty simple, but could not get it :(.
In this format Z is time zone.
T is long time pattern
How could I get a date in this format except by using
DateTime dt = DateTime.Now;
Console.WriteLine(dt.ToString("yyyy-MM-ddTHH:mm:ssZ"));
in C#
Using UTC
ISO 8601 (MSDN datetime formats)
The Z is there because
If you want to include an offset
Two things to note: + or – is needed after the time but obviously + doesn’t show on positive numbers. According to wikipedia the offset can be in +hh format or +hh:mm. I’ve kept to just hours.
As far as I know, RFC1123 (HTTP date, the “u” formatter) isn’t meant to give time zone offsets. All times are intended to be GMT/UTC.