When converting times between time zones. I found the follow code works. However I am not sure how programmatically what to put as my offset for the constructor for the ZonedDateTime
. I had a choice of one of the offsets on zoneChicago, which is just two, because its either with our without daylight savings, but how do I know which one I use, and for timezones that have more then just two, what is the best way to populate that offset?
Thanks,
Jim
var zoneLA = c.GetZoneOrNull("America/Los_Angeles");
var zoneChicago = c.GetZoneOrNull("America/Chicago");
var zdtChicago = new ZonedDateTime( LocalDateTime.FromDateTime(DateTime.Now)
, zoneChicago
, zoneChicago.MaxOffset);
var zdtLA = zdtChicago.WithZone(zoneLA);