Hi @StewartBW The behavior you are observing is likely due to the distinction between Standard Time and Daylight Saving Time. Eastern Standard Time (EST) has a UTC offset of -5, while Eastern Daylight Time (EDT), which is observed during the summer months, has a UTC offset of -4.
When you run the code during the period when Daylight Saving Time is in effect, the UTC offset will be -4, which corresponds to Eastern Daylight Time (EDT).
You may need to manually change the offset to EST.
Dim estZone As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")
Dim currentDate As DateTime = DateTime.Now
Dim estTime As DateTime = TimeZoneInfo.ConvertTime(currentDate, TimeZoneInfo.Local, estZone)
Dim estOffset As TimeSpan = estZone.BaseUtcOffset
Dim formattedDate As String = estTime.ToString("ddd, dd MMM yyyy HH:mm:ss") & " " & estOffset.ToString("hh\:mm")
Best Regards.
Jiachen Li
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.