Dates and Time Zone problem (to Armin, Cor or who can help) :))

  • Thread starter Thread starter Cesar Ronchese
  • Start date Start date
Inside the zip there is a RTF file explaining the problem, a little more
organised than that previous posts. Additionally, says how to run the
samples.

The start application is prj_errordate_server, and the RTF is embedded
inside there for a easy look.

[]s
Cesar
 
Cesar,

Nice sample, however to verify, "you wrote no problems exist with a normal
connection?

The problem you show now is in my opinion exactly the same as with a
webpage. You have to know the timezone from the client to correct that. On
the serverside you know that.

http://www.timeanddate.com/worldclock/setpersonal.html

Just my idea.

Cor
 
Cesar,

By the way, it would be nice if they made it possible that the
servervariables would return the culture and the timezone of the client.

This does not help you, however you never know who reads this.

Cor
 
Cesar Ronchese said:
Hi,

I built the sample code showing the problem with dates when viewed at
different machines, different Time Zones and transported via Remoting.

The zip can be downloaded here:

www.carsoftnet.com.br/temp/sample_error_date.zip

I also had a look now. There is too much for me that I don't understand. I
know nothing about httpchannel and remoting, I don't have an SQL server
installed and I don't have a 2nd machine (ready for testing). Bad conditions
to help you. ;-) What I can do is examine the code. Well, after 30 min, I am
not much cleverer. :) All I can say is: I don't know where the conversion
takes place. I would have to test this. Sorry, can't help you here! Maybe
Cor or somebody else can?


Armin
 
Eureka.

Someone posted a message a couple of hours ago in
microsoft.public.dotnet.framework asking if a problem concerning time zone
conversion when sending datasets over web services in Framework 1.x? had
been resolved on Framework 2.0.

A quick look at the DataColumn class in FrameWork 2.0 shows a new property
DataTimeMode that appears to be designed to control how the values in
DateTime columns are handled during serialization/deserialization.

It appears that in Framework 1.x there is some unintended consequence caused
by assumptions when serializing datacolumns of type DateTime when the
serializing machine is in a different time zone than the deserializing
machine and this could very well be the cause of Cesar's 'issue'.
 
Ken,

I have seen more told that the language code (it is returned standard in the
systemvariables which we use to filter our IP addresses) could be used. In
my opinion is that language the most dangerous thing to use.

Assume you buy something to deliver on 11012006 with an English language.
Which date will you assume that this is. Exactly in the most countries
using the English language 11 januari 2006. While probably for the most
persons using the English language it is november 01 2006.

:-)

The IP address is interesting however I did not see that French and English
Canada have a seperated IP range as well is that not for Belgium which has 3
languages and Swis which has four. I know than the country however nothing
about the used culture.

I have very much the idea that the IP addresses in that csv file are not an
official range, but something that is collected. It says 99% procent
accurate, from where is that, over the whole world or only in the USA.

You can than of course use the combination of language and supposed country,
however still I would like it more if the system variables just would give
back for you "en-US", for Peter "nl-BE" and for me "nl-NL".

In addition than as well the timezone because that you are in the USA does
not say anything about your timezone.

Just my thought,

However as always thanks.

:-)

Cor
 
Sephany,

If I use net 1.1 I get

<myDutchDateToday>2005-12-13T15:39:46.2031250+01:00</myDutchDateToday>

Where the +1 means that the CET time that I am using is +1 to the UTC time.
This is done with VB2003.

If I use in Net 2.0 the DateTime.UTC than I get
<myDutchDateToday>2005-12-13T14:36:06.734375Z</myDutchDateToday>

Z from Zulu = Greenwich MeanTime GMT or UTC Universal Time Coordinated..

If I use in Net 2.0 the DateTime.local than I get the same as in Net 1.0
<myDutchDateToday>2005-12-13T15:39:46.2031250+01:00</myDutchDateToday>

So therefore what does this help?

Cor
 
Cesar,

Looking again at your program it is not impossible that the message from
Stephany will help you, however than more that maybe the Net 1.x is not
using the datetime zone information in an XML file.

That is easy to check of course by changing that +001 or whatever it is
which is at your place, I am for sure that it is a -xxx value guesing it
is -005.

Cor
 
Stephany,
| A quick look at the DataColumn class in FrameWork 2.0 shows a new property
| DataTimeMode that appears to be designed to control how the values in
I wonder if DateTimeMode maps to new DateTime.Kind property?

| It appears that in Framework 1.x there is some unintended consequence
caused
| by assumptions when serializing datacolumns of type DateTime when the
My understanding is that is the essence of the reason why the DateTime.Kind
property was introduced.

http://msdn2.microsoft.com/e3t6hfy5(en-US,VS.80).aspx

DateTime.Kind indicates if a DateTime value is local time, Utc time, or
unspecified.

http://msdn2.microsoft.com/system.datetimekind.aspx

It allows the framework, specifically DateTime.ToLocalTime &
DateTime.ToUniveralTime to know if the DateTime value is already local or
Utc time.

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


| Eureka.
|
| Someone posted a message a couple of hours ago in
| microsoft.public.dotnet.framework asking if a problem concerning time zone
| conversion when sending datasets over web services in Framework 1.x? had
| been resolved on Framework 2.0.
|
| A quick look at the DataColumn class in FrameWork 2.0 shows a new property
| DataTimeMode that appears to be designed to control how the values in
| DateTime columns are handled during serialization/deserialization.
|
| It appears that in Framework 1.x there is some unintended consequence
caused
| by assumptions when serializing datacolumns of type DateTime when the
| serializing machine is in a different time zone than the deserializing
| machine and this could very well be the cause of Cesar's 'issue'.
|
|
|
| | > "Cesar Ronchese" <ronchese_hotmail_dot_com> schrieb im Newsbeitrag
| > | >> Hi,
| >>
| >> I built the sample code showing the problem with dates when viewed at
| >> different machines, different Time Zones and transported via Remoting.
| >>
| >> The zip can be downloaded here:
| >>
| >> www.carsoftnet.com.br/temp/sample_error_date.zip
| >>
| >
| > I also had a look now. There is too much for me that I don't understand.
I
| > know nothing about httpchannel and remoting, I don't have an SQL server
| > installed and I don't have a 2nd machine (ready for testing). Bad
| > conditions to help you. ;-) What I can do is examine the code. Well,
after
| > 30 min, I am not much cleverer. :) All I can say is: I don't know where
| > the conversion takes place. I would have to test this. Sorry, can't help
| > you here! Maybe Cor or somebody else can?
| >
| >
| > Armin
|
|
 
Ah!
I see the relation between DateTimeKind & DataSetDateTime.

I'll have to try DateTimeKind with remoting w/o DataSets & the benefit of
DataSetDateTime.

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


"Cesar Ronchese" <ronchese_hotmail_dot_com> wrote in message
| Got it!! The tip from Stephany about .net 2.0 worked, just need to apply
in
| each datetime datacolumn the following code:
|
| dtbTable.Columns(i).DateTimeMode = DataSetDateTime.Unspecified
|
| And well, for now, I need to know what will be the size of the job to
| convert the program, hehe.
|
| All helps appreciatted!
|
| []s
| Cesar
|
|
|
|
|
|
|
|
| | > Sephany,
| >
| > If I use net 1.1 I get
| >
| > <myDutchDateToday>2005-12-13T15:39:46.2031250+01:00</myDutchDateToday>
| >
| > Where the +1 means that the CET time that I am using is +1 to the UTC
| > time. This is done with VB2003.
| >
| > If I use in Net 2.0 the DateTime.UTC than I get
| > <myDutchDateToday>2005-12-13T14:36:06.734375Z</myDutchDateToday>
| >
| > Z from Zulu = Greenwich MeanTime GMT or UTC Universal Time Coordinated..
| >
| > If I use in Net 2.0 the DateTime.local than I get the same as in Net 1.0
| > <myDutchDateToday>2005-12-13T15:39:46.2031250+01:00</myDutchDateToday>
| >
| > So therefore what does this help?
| >
| > Cor
| >
| >
| > "Stephany Young" <noone@localhost> schreef in bericht
| > | >> Eureka.
| >>
| >> Someone posted a message a couple of hours ago in
| >> microsoft.public.dotnet.framework asking if a problem concerning time
| >> zone conversion when sending datasets over web services in Framework
1.x?
| >> had been resolved on Framework 2.0.
| >>
| >> A quick look at the DataColumn class in FrameWork 2.0 shows a new
| >> property DataTimeMode that appears to be designed to control how the
| >> values in DateTime columns are handled during
| >> serialization/deserialization.
| >>
| >> It appears that in Framework 1.x there is some unintended consequence
| >> caused by assumptions when serializing datacolumns of type DateTime
when
| >> the serializing machine is in a different time zone than the
| >> deserializing machine and this could very well be the cause of Cesar's
| >> 'issue'.
| >>
| >>
| >>
| >> | >>> "Cesar Ronchese" <ronchese_hotmail_dot_com> schrieb im Newsbeitrag
| >>> | >>>> Hi,
| >>>>
| >>>> I built the sample code showing the problem with dates when viewed at
| >>>> different machines, different Time Zones and transported via
Remoting.
| >>>>
| >>>> The zip can be downloaded here:
| >>>>
| >>>> www.carsoftnet.com.br/temp/sample_error_date.zip
| >>>>
| >>>
| >>> I also had a look now. There is too much for me that I don't
understand.
| >>> I know nothing about httpchannel and remoting, I don't have an SQL
| >>> server installed and I don't have a 2nd machine (ready for testing).
Bad
| >>> conditions to help you. ;-) What I can do is examine the code. Well,
| >>> after 30 min, I am not much cleverer. :) All I can say is: I don't
know
| >>> where the conversion takes place. I would have to test this. Sorry,
| >>> can't help you here! Maybe Cor or somebody else can?
| >>>
| >>>
| >>> Armin
| >>
| >>
| >
| >
|
|
 
As I could see, the problem is not really easy to resolve :D

I should implement time conversion everytime I get the datatable via the
remoting and convert when write again to database, I got well the idea? I'll
need use some sweat to do it, but is possible. However I can find some
problems of inconsistencies, mainly if the user changes the time zone after
the program have retrieved the data.

I'll check the Stephany Young reply, about the correction in framework 2.0,
before need to go to manual conversion!

Thank you folks very much for the hand.

[]s
Cesar
 
Got it!! The tip from Stephany about .net 2.0 worked, just need to apply in
each datetime datacolumn the following code:

dtbTable.Columns(i).DateTimeMode = DataSetDateTime.Unspecified

And well, for now, I need to know what will be the size of the job to
convert the program, hehe.

All helps appreciatted!

[]s
Cesar
 
Nice sample (...)

cool, thanks :)) I write this message only to appreciate your comment. Your
help I thank in messages below.

[]s
Cesar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top