I am using the TimeZoneInfo class to convert a Datetime value to UTC. However, the conversion does not take care of Daylight Savings Time automatically. How can I achieve that.
For instance, I am trying to convert the following DateTime to UTC:
//meetingDate is "10/04/2019 12:00:00" PM
var timeZoneId="AUS Eastern Standard Time";
DateTime dtUTC = TimeZoneInfo.ConvertTime(meetingDate, TimeZoneInfo.FindSystemTimeZoneById(timeZoneId), TimeZoneInfo.Utc);
the value returned is: 10/04/2019 02:00:00 UTC (am)
And this is because the Time zone in my operative system for "AUS Eastern Standard Time" is UTC + 10:00 (See image below) But because the "Adjust for daylight saving time Automatically" Setting is enabled , I am able to see the right time on my windows 10 (which is actually at this specific moment (1st April 2019) UTC + 11)
How can i get the same behaviour using TimeZoneInfo.ConvertTime method.
That if i pass the value "10/04/2019 12:00:00 PM" I should get back: 10/04/2019 01:00:00 am UTC
P.S: I have checked out the following stack overflow question but it is converting from UTC, So it does not apply to my question.
How to use TimeZoneInfo to get local time during Daylight Savings Time?
Image Windows 10 Timezone: