Skip to content

asp core 3.1 set global default timezone? #42153

Discussion options

You must be logged in to vote

It has to be done through the User settings or the machine admin. We don't have API to set the default time zone on the machine because it need a specific privilege to do it which is turned off by default.

As user if you want to change the TZ from the settings you may follow the steps https://support.microsoft.com/en-us/help/4026213/windows-how-to-set-your-time-and-time-zone.

If you want to do it by APIs, you may consider pinvoke to https://docs.microsoft.com/en-us/windows/win32/api/timezoneapi/nf-timezoneapi-settimezoneinformation but you have to work getting the needed privlage before doing so or the API will fail.

Replies: 7 comments 26 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@tarekgh
Comment options

Answer selected by tarekgh
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
20 replies
@EvgenyPrikhodko
Comment options

@tarekgh
Comment options

@EvgenyPrikhodko
Comment options

@tarekgh
Comment options

@fukasawah
Comment options

Comment options

You must be logged in to vote
3 replies
@EvgenyPrikhodko
Comment options

@tarekgh
Comment options

@EvgenyPrikhodko
Comment options

Comment options

You must be logged in to vote
1 reply
@SteveDesmond-ca
Comment options

Comment options

You must be logged in to vote
1 reply
@PathogenDavid
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants