Forum Discussion
smpa01
2 years agoCommunity Champion
utc and client offset
how can I dynamically get the offset between utc and client.
The follwoing does not work
DateTimeZone.UtcNow()-DateTimeZone.LocalNow())
I want this to result in -4 as I am in EST.
Thank you in advance.
Some areas are offset by hours and minutes, hence the second line:
= DateTimeZone.ZoneHours(DateTimeZone.FixedLocalNow()) + DateTimeZone.ZoneMinutes(DateTimeZone.FixedLocalNow()) / 60