Offset from GMT

  • Thread starter Thread starter Rich Raffenetti
  • Start date Start date
R

Rich Raffenetti

I have an asp.net application that presents some user account information
from Active Directory. I want to present current dates and times to the
users in cases where the raw date/time is in GMT. Since the GMT offset
changes depending on the time of year, the program would need to change
twice a year. If I can determine the current offset from GMT from the
system, then I wouldn't have to change the program. I know that the system
knows the offset since it records the dates in GMT. Is it an easy value to
obtain from the system? My .Net skills are quite rudimentary. Thanks for
any help or references.
 
You can use the DataTime.ToUniversalTime() method to set any local DateTime
to GMT. Similarly, you can find the offset of local time to GMT by
subtracting the local time from the local time as GMT, using the same
method.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.
 
Back
Top