PC Review


Reply
Thread Tools Rate Thread

Date Time format Problem

 
 
Alessandro
Guest
Posts: n/a
 
      7th Nov 2003
Hi !
I have a pocket pc application which retirve some data from a web-service:
this web service put out a dataset with a datetime fields: this time is in
UTC standard.

How can i "translate" it into pocketPC system datetime format ?


 
Reply With Quote
 
 
 
 
Peter Foot [MVP]
Guest
Posts: n/a
 
      7th Nov 2003
Use the method ToLocalTime() to convert a UTC DateTime to the local time as
specified by your devices current timezone offset. Likewise you can use
ToUniversalTime() to convert your local datetime values back into a UTC
DateTime.

Peter

--
Peter Foot
Windows Embedded MVP
OpenNETCF.org Senior Advisor
www.inthehand.com | www.opennetcf.org

"Alessandro" <(E-Mail Removed)> wrote in message
news:u$o$(E-Mail Removed)...
> Hi !
> I have a pocket pc application which retirve some data from a web-service:
> this web service put out a dataset with a datetime fields: this time is in
> UTC standard.
>
> How can i "translate" it into pocketPC system datetime format ?
>
>



 
Reply With Quote
 
Alessandro
Guest
Posts: n/a
 
      13th Nov 2003
It doesn't work like this......


Ok, i try to explain better:

1) i have a web service function to retrive a dataset of elements with a
datetime attribute:
a) in DB this attribute has a value like "09/15/2003"
b) when i call the function from an explorer
http://machine/service.asmx, i can see that in the XML
returned is 20030915T00:00:00.0000000 +02:00

2) if i call this function on pocketPC application, in the dataset i find
this value... before i can try to do any type of conversion.....:
09/09/2003 15:00



"Peter Foot [MVP]" <(E-Mail Removed)> ha scritto nel messaggio
news:(E-Mail Removed)...
> Use the method ToLocalTime() to convert a UTC DateTime to the local time

as
> specified by your devices current timezone offset. Likewise you can use
> ToUniversalTime() to convert your local datetime values back into a UTC
> DateTime.
>
> Peter
>
> --
> Peter Foot
> Windows Embedded MVP
> OpenNETCF.org Senior Advisor
> www.inthehand.com | www.opennetcf.org
>
> "Alessandro" <(E-Mail Removed)> wrote in message
> news:u$o$(E-Mail Removed)...
> > Hi !
> > I have a pocket pc application which retirve some data from a

web-service:
> > this web service put out a dataset with a datetime fields: this time is

in
> > UTC standard.
> >
> > How can i "translate" it into pocketPC system datetime format ?
> >
> >

>
>



 
Reply With Quote
 
Guest
Posts: n/a
 
      10th Dec 2003
Hello Peter!

Some 'days' ago someone asked
> I have a pocket pc application which retirve some data from a web-service:
> this web service put out a dataset with a datetime fields: this time is in
> UTC standard.
> How can i "translate" it into pocketPC system datetime format ?


You advised to
> Use the method ToLocalTime() to convert a UTC DateTime to the local time

as
> specified by your devices current timezone offset.


I think I'm troubled by the same problem. On which step of the workflow do I
have to convert the values? It seems like there are already 'wrong' values
in the dataset after downloading it from the webservice. On displaying the
data on the ppc wether ToLocalTime nor ToUniversalTime provides the expected
value.

BTW: The data is taken from a MS-Access-DB, but filled into the DataSet by
hand, not with the help of a DataAdapter. Could this be a reason?

Thanks D.Barisch


 
Reply With Quote
 
Peter Foot [MVP]
Guest
Posts: n/a
 
      10th Dec 2003
Have you compared the contents of the DataSet with the original values in
Access? Perhaps you can explain how you are creating the DataSet in more
detail.

Peter

--
Peter Foot
Windows Embedded MVP
OpenNETCF.org Senior Advisor
www.inthehand.com | www.opennetcf.org

<Daniel Barisch> wrote in message
news:(E-Mail Removed)...
> Hello Peter!
>
> Some 'days' ago someone asked
> > I have a pocket pc application which retirve some data from a

web-service:
> > this web service put out a dataset with a datetime fields: this time is

in
> > UTC standard.
> > How can i "translate" it into pocketPC system datetime format ?

>
> You advised to
> > Use the method ToLocalTime() to convert a UTC DateTime to the local time

> as
> > specified by your devices current timezone offset.

>
> I think I'm troubled by the same problem. On which step of the workflow do

I
> have to convert the values? It seems like there are already 'wrong' values
> in the dataset after downloading it from the webservice. On displaying the
> data on the ppc wether ToLocalTime nor ToUniversalTime provides the

expected
> value.
>
> BTW: The data is taken from a MS-Access-DB, but filled into the DataSet by
> hand, not with the help of a DataAdapter. Could this be a reason?
>
> Thanks D.Barisch
>
>



 
Reply With Quote
 
Guest
Posts: n/a
 
      10th Dec 2003
> Have you compared the contents of the DataSet with the original values in
> Access?


OK, I'll take myself some time for testing....

= Country-Setting =
WebServer: "Deutsch (Deutschland)"
Emulator / PPC: "Deutsch (Standard)"

= Example-Value in DataSet (UTC / Local ) =
WebServer (just before downloading):
31.12.2002 23:00:00 / 01.01.2003 01:00:00 (which should be the correct one)

Emulator:
31.12.2002 23:00:00 / 31.12.2002 07:00:00

PocketPC:
31.12.2002 23:00:00 / 01.01.2003 01:00:00

Back again...
Uhm, as I see, it only affects the Emulator? There's maybe a wrong
time-difference stored?

But am I right, that the MS-DataGrid (for CF) always displays the UTC-Time?
As I remember, that's where I considered that problem. I won't test this
issue, because meanwhile I'm using an other Grid, but maybe this information
would be interesting for other users.

Thanks for your help and your quick response!
D.Barisch


 
Reply With Quote
 
Peter Foot [MVP]
Guest
Posts: n/a
 
      10th Dec 2003
The emulator has a couple of issues regarding the time and should not be
trusted to be fully accurate, the clock does not appear to correctly refresh
when the emulator has been suspended, in which case you should do a hard
shutdown of the emulator and start it up from fresh (you'll need to set the
timezone again after doing this).

The DataGrid will show whatever value is in the DateTime in its full string
format - thus if your DataSet retrieved contains UTC times this is what will
be displayed, the DataGrid sadly does not support much formatting of data.

Peter

--
Peter Foot
Windows Embedded MVP
OpenNETCF.org Senior Advisor
www.inthehand.com | www.opennetcf.org

<Daniel Barisch> wrote in message
news:(E-Mail Removed)...
> > Have you compared the contents of the DataSet with the original values

in
> > Access?

>
> OK, I'll take myself some time for testing....
>
> = Country-Setting =
> WebServer: "Deutsch (Deutschland)"
> Emulator / PPC: "Deutsch (Standard)"
>
> = Example-Value in DataSet (UTC / Local ) =
> WebServer (just before downloading):
> 31.12.2002 23:00:00 / 01.01.2003 01:00:00 (which should be the correct

one)
>
> Emulator:
> 31.12.2002 23:00:00 / 31.12.2002 07:00:00
>
> PocketPC:
> 31.12.2002 23:00:00 / 01.01.2003 01:00:00
>
> Back again...
> Uhm, as I see, it only affects the Emulator? There's maybe a wrong
> time-difference stored?
>
> But am I right, that the MS-DataGrid (for CF) always displays the

UTC-Time?
> As I remember, that's where I considered that problem. I won't test this
> issue, because meanwhile I'm using an other Grid, but maybe this

information
> would be interesting for other users.
>
> Thanks for your help and your quick response!
> D.Barisch
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date/Time Format Problem briandhowells@gmail.com Microsoft Excel Misc 1 13th Aug 2007 05:18 PM
Time/Date Format Problem Curtis Microsoft VB .NET 0 1st Sep 2005 04:33 PM
Date Time Format Problem okaminer Microsoft VB .NET 10 3rd Aug 2005 02:41 PM
Q : Problem With Date Time Display Format Marauderz Microsoft ASP .NET 2 19th Jul 2004 07:19 PM
How to solve this Date/Time format problem? Thank You. Miguel Dias Moura Microsoft ASP .NET 0 2nd Apr 2004 12:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:45 AM.