[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1213
  • Last Modified:

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
0
YRKS
Asked:
YRKS
  • 2
1 Solution
 
cookreCommented:
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

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now