I am getting some anomalies when using the C# built-ins to convert from ET to GMT. The program is parsing a file containing US Eastern Time zone date stamps for projected power loads. To store the info, the Eastern Time is converted to GMT. Code snippet is:
DateTime _date;
TimeZoneInfo et = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
TimeZoneInfo gmt = TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time");
...
DateTime.TryParse(table[_r, 0], out _date);
p.dtLocal = _date;
p.dtGMT = TimeZoneInfo.ConvertTime(p.dtLocal, et, gmt);
To start with, the function is adding 5 hours to Eastern to get GMT. The date today is Oct 22, 2017, so it should only be adding four hours. Secondly, on Oct 29th, at 1:00AM local, it changes to adding 4 hours. This change should take place after Nov 5, 2017 in the US, after which it should be adding 5 hours.
(before conversion)
dtGMT {10/23/2017 12:00:00 AM} System.DateTime
dtLocal {10/23/2017 1:00:00 AM} System.DateTime
(after conversion)
dtGMT {10/23/2017 6:00:00 AM} System.DateTime
dtLocal {10/23/2017 1:00:00 AM} System.DateTime
Am I using the functions incorrectly?