Offset from GMT

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.
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,731
Latest member
MarcyGipso

Latest Threads

Top