Solved

vb.net + convert time from MST to GMTzone

Posted on 2007-11-21
3
1,181 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
Comment Utility
timevar.ToUniversal()
0
 

Author Comment

by:YRKS
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A short article about a problem I had getting the GPS LocationListener working.
A short article about problems I had with the new location API and permissions in Marshmallow
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

762 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

7 Experts available now in Live!

Get 1:1 Help Now