G
Guest
Hi,
I've already found out that .Net Framework 1.1 does not properly handle
anything that is related to a non-current timezone. Since my project should
be released before the release of Framework 2.0, I am kindly asking if
anybody knows a workaround for the following:
My database stores various locations, and for each location we store a GMT
offset (number of hours). When the user selects a location, the program can
instantly obtain the GMT offset of this location. Then I take the
DateTime.UTCNow and add the offset to that value. As a result I am getting a
DateTime that holds the current date and time for a location that is in a
timezone that is different to the current machine setting. However, this
value will only be correct for the standard time (because we store the
standard offset in the DB). I have to determine if that timezone is currently
applying the daylight savings. If yes, I can add/substract 1 hour from my
variable. Question: how can I determine the daylight savings for a different
timezone?
Any references to the existing free components or code snippets or
explanations will be highly appreciated.
Note: I am happy to change the way we store the GMT offset (e.g. store the
standard timezone name instead) if required. Reading the registry will be
fine too, just tell what and where to read.
Thanks in advance,
Anna
I've already found out that .Net Framework 1.1 does not properly handle
anything that is related to a non-current timezone. Since my project should
be released before the release of Framework 2.0, I am kindly asking if
anybody knows a workaround for the following:
My database stores various locations, and for each location we store a GMT
offset (number of hours). When the user selects a location, the program can
instantly obtain the GMT offset of this location. Then I take the
DateTime.UTCNow and add the offset to that value. As a result I am getting a
DateTime that holds the current date and time for a location that is in a
timezone that is different to the current machine setting. However, this
value will only be correct for the standard time (because we store the
standard offset in the DB). I have to determine if that timezone is currently
applying the daylight savings. If yes, I can add/substract 1 hour from my
variable. Question: how can I determine the daylight savings for a different
timezone?
Any references to the existing free components or code snippets or
explanations will be highly appreciated.
Note: I am happy to change the way we store the GMT offset (e.g. store the
standard timezone name instead) if required. Reading the registry will be
fine too, just tell what and where to read.
Thanks in advance,
Anna