We are downloading data from our trading partner's API. Till now we were working with "E. Australia Standard Time" and it was working fine.
After daylight saving started our trading partner said that they are working with "Australian Eastern Daylight Time (AEDT)".
I have used following code to convert from UTC to "E. Australia Standard Time".
DateTime utcTime = DateTime.UtcNow;
TimeZoneInfo objTimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("E. Australia Standard Time");
DateTime TPDateTime = TimeZoneInfo.ConvertTimeFromUtc(utcTime, objTimeZoneInfo);
But I am getting following errors when I use "E. Australia Daylight Time" or "Australian Eastern Daylight Time (AEDT)"
The time zone ID 'E. Australia Daylight Time' was not found on the local computer.
The time zone ID 'Australian Eastern Daylight Time (AEDT)' was not found on the local computer.
What timezone id should I pass to FindSystemTimeZoneById() method to convert correctly to Australian Eastern Daylight Time (AEDT)?
Currently has same time zone offset as AEDT (UTC +11) but different time zone name. Australian Eastern Daylight Time (AEDT) is 11 hours ahead of Coordinated Universal Time (UTC). This time zone is a Daylight Saving Time time zone and is used in: Australia.
Australia uses three main time zones: Australian Western Standard Time (AWST; UTC+08:00), Australian Central Standard Time (ACST; UTC+09:30), and Australian Eastern Standard Time (AEST; UTC+10:00).
Australian Eastern Standard Time (AEST) is 10 hours ahead of Coordinated Universal Time (UTC). This time zone is in use during standard time in: Australia.
You probably want to use "AUS Eastern Standard Time" (for Canberra, Hobart, Melbourne and Sydney). Despite having the word "Standard" in the name, this accounts for daylight savings time and uses UTC+10 in winter and UTC+11 in summer:
var tz = TimeZoneInfo.FindSystemTimeZoneById("AUS Eastern Standard Time");
TimeZoneInfo.ConvertTimeFromUtc(new DateTime(2018,1,1,0,0,0,DateTimeKind.Utc), tz);
// => 01/01/2018 11:00:00
TimeZoneInfo.ConvertTimeFromUtc(new DateTime(2018,7,1,0,0,0,DateTimeKind.Utc), tz);
// => 01/07/2018 10:00:00
The "E. Australia Standard Time" time zone is for Brisbane, where they do not observe daylight savings time.
You can get a complete list of available time zones using the TimeZoneInfo.GetSystemTimeZones()
method, or by running tzutil /l
at the command line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With