How do I generally set a TimeZone for the application session

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

I want my .NET Windows Form client to be executing with the same TimeZone &
Daylight setting as we have on the server. This has to be done to stop making
the "data set/web service logic" changing date values accordning to time zone
difference.

Let us to simplify the scenarion say that the time zone used on server can
be hard coded in client, it will never change.

It is possible to change something in
"System.Threading.Thread.CurrentThread.CurrentCulture"
or "System.Windows.Forms.Application" ?

Of course I do not want my application to change the setting on the client
machine, only my application should be affected.

Best regards,
Benjamin, Sweden
 
You can't set the current time zone through managed code, on either the
machine or process level.
We are looking into adding timezone features for future versions of the
Framework, but it's not there now.

I recommend you transmit and store all date values as UTC, and only use the
local timezone for displaying.

Katy

From: "=?Utf-8?B?QmVuamFtaW4=?=" <[email protected]>
|
| Hi!
|
| I want my .NET Windows Form client to be executing with the same TimeZone
&
| Daylight setting as we have on the server. This has to be done to stop
making
| the "data set/web service logic" changing date values accordning to time
zone
| difference.
|
| Let us to simplify the scenarion say that the time zone used on server
can
| be hard coded in client, it will never change.
|
| It is possible to change something in
| "System.Threading.Thread.CurrentThread.CurrentCulture"
| or "System.Windows.Forms.Application" ?
|
| Of course I do not want my application to change the setting on the
client
| machine, only my application should be affected.
|
| Best regards,
| Benjamin, Sweden
|
 
Hi!

We see no manageble way to work with DateTime format, in our case.
We are going to convert the database column to string,
and send strings over web services and present strings in clients.

Thanks anyway.

Benjamin,
Sweden
 
and send strings over web services and present strings in clients.

The strings should be in an ISO8601 format, preferably in UTC.
 
Back
Top