(Sorry if this is a duplicate post. I'm not sure if my newsreader was set up
right.)
---------------------------------
My computer is a client in the central timezone with daylight savings.
I need to pass a time and a value to the server via webservices (for
example, the price of electricity at each hour in the future). Suppose I
want to send these four times and values to the server:
2006-10-29 05:30 GMT, $1.50
2006-10-29 06:30 GMT, $1.60
2006-10-29 07:30 GMT, $1.23
2006-10-29 08:30 GMT, $1.35
Since my computer is in the central timezone, there is no way I can find to
create a time equivalent to the 7:30 GMT time. It should interpret these
times as:
12:30 AM CDT (05:30 GMT)
1:30 AM CDT (06:30 GMT)
<----- (clocks roll back to standard time)
1:30 AM CST (07:30 GMT)
2:30 AM CST (08:30 GMT)
Based on my observations with the .ToUniversalTime method, you get only
these times:
12:30 AM CDT (05:30 GMT)
1:30 AM CDT (06:30 GMT)
2:30 AM CST (08:30 GMT)
7:30 GMT can't be represented.
Similarly, 6:30 GMT can't be represented on a client in the eastern time zone.
How can I send the missing hour to a webservice? I can't change the time on
the client machine and I can't change the server side method to accept a
different data type.
The only solutions I can think of so far are to set my app to run in a
timezone that doesn't use daylight savings (I'm not sure it that is possible
without changing the client's system clock) or override the
deserialization/serialization to get/set the timezone part of the xml
message. I don't know how to do either of these, so I hope there is a simple
example somewhere or a different option.
I realize I'll have to handle timezone conversions within my client code.
Assuming I can keep things straight, however, my main concern is being able
to communicate an instant in time to the server when it falls within the
first hour of the switch back to "standard time".
Please advise. Thank you