Date Time format Problem

  • Thread starter Thread starter Alessandro
  • Start date Start date
A

Alessandro

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 ?
 
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
 
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
 
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
 
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
 
Have you compared the contents of the DataSet with the original values in

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
 
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
 
Back
Top