I recently started using NodaTime and I must say it is a fantastic piece of work.
However, just to test that I am doing things right, I took IANA timezone names from here and printed UTC Offsets for each using NodaTime.
/* string[] ALL_ZONE_NAMES = list of zone names */
foreach(var timezone in ALL_ZONE_NAMES)
{
var ob = DateTimeZoneProviders.Tzdb[timezone];
Console.WriteLine($"{timezone} --> {ob.GetUtcOffset(new Instant())}");
}
Now, for a particular timezone say Pacific/Apia
, offset was printed as -11
,
but when I tried same on Chrome browser (console) from the momentJS, I got +14
moment.tz(new Date().toISOString(), "Pacific/Apia").format()
"2020-12-10T01:33:13+14:00"
Am I missing something ?
+14
look suspiciously like DST. Which is indeed currently in effectWhat does the database itself contain for those timezones?
which database ? You meanDateTimeZoneProviders.Tzdb
? How do I check that ?