Advertisement

05.25.2008 at 01:24PM PDT, ID: 23431564
[x]
Attachment Details

Working with DateTime independent of Timezone

Asked by schwarz2 in Visual Studio, Miscellaneous Programming, Microsoft Visual Basic.Net

Tags:

Hello,

I am working with a VB.NET 2005 application in which I need to store date and time information.  I'm using a datagridview which is backed by a datatable (unbound to a database).  At the end of every session, I write this datatable to an XML file, and in new sessions I attempt to reload the datatable from the stored XML (ReadXML/WriteXML methods).

My goal is to make the application independent of timezones.  If I'm in GMT-5 and store datetime info, I want to be able to write this to the XML file, then change my computer to GMT-8, reload the datatable, and see that datetime exactly as originally input.  5:00pm is 5:00pm whether in Eastern Time or Pacific Time.

Of course, the answer typically suggested is to use Universal Time.  That's okay, but I need help in making the application stay in the Universal Time mentality.  I need the datagridview to not do any conversions to local time and to properly write to the XML with the +00:00 extension.

Any ideas?
(By the way, if you can answer this question, you can probably answer this person's question which is about to be deleted, I think:  http://www.experts-exchange.com/Programming/Languages/.NET/Class_Libraries/ADO.NET/Q_23307356.html ).

Many many thanks.Start Free Trial
[+][-]05.25.2008 at 02:23PM PDT, ID: 21643677

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.25.2008 at 04:02PM PDT, ID: 21643898

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.25.2008 at 04:04PM PDT, ID: 21643905

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.25.2008 at 04:20PM PDT, ID: 21643943

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.25.2008 at 06:19PM PDT, ID: 21644227

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio, Miscellaneous Programming, Microsoft Visual Basic.Net
Tags: VB.NET 2005
Sign Up Now!
Solution Provided By: ororiole
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.25.2008 at 11:59PM PDT, ID: 21645023

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628