问题
Hi i have created the asp.net web application without considering the time zone. I am using directly the DateTime.Now function. Actually that returns datetime in server configured time zone format. Now i cant change entire application. so is there any way set the TimeZone of application independent of server in which it is hosted? or is there any way to set in web config file.
回答1:
TimeZone.CurrentTimeZone
is used for the time zone on the computer where the code is executing.
Check these links: http://msdn.microsoft.com/en-us/library/system.timezone.currenttimezone.aspx
http://msdn.microsoft.com/en-us/library/system.timezoneinfo.local.aspx
来源:https://stackoverflow.com/questions/14293858/how-to-set-default-time-zone-in-asp-net-application