Solved

vb.net + convert time from MST to GMTzone

Posted on 2007-11-21
3
1,182 Views
Last Modified: 2008-02-01
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
Comment
Question by:YRKS
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
cookre earned 500 total points
ID: 20331951
timevar.ToUniversal()
0
 

Author Comment

by:YRKS
ID: 20332016
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
 
LVL 22

Expert Comment

by:cookre
ID: 20332195
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now