vb.net + convert time from MST to GMTzone

I have  aserver which is configured to save the MST. I need to convert the now() from the MST to GMT in my code. This should work all year around even for Daylight savings plan.

How would I do this?

YRKS
YRKSAsked:
Who is Participating?
 
cookreConnect With a Mentor Commented:
timevar.ToUniversal()
0
 
YRKSAuthor Commented:
Yes I think that's exactly what I was looking for. This would take care of the daylight savings plan right. I am  just supposed to save the current date and time as GMT time when I create a new record.
YRKS
0
 
cookreCommented:
Yes.  Now() is associated local time, and the state of local DST is known and taken into account.

Unless one KNOWS that no times or dates other than local will ever be used, prudence dictates that ALL date/times be stored as Universal., then converted to local (or whatever) only on output.

0
All Courses

From novice to tech pro — start learning today.