[SOLVED] Can I Force A ASP.Net Website to Show Time in A Specific Time Zone?

Issue

I have a client request that all times be displayed in Pacific Time Zone, regardless of client settings. I’d like to avoid a scenario where I have to call a function for every time display and instead have a single point where I can make the switch.

I’m thinking a custom culture might do the trick, but I wanted to ask before I set off down a potentially blind alley (or miss something trivially easy).

Solution

You could use TimeZone.GetUTCOffset() and DateTime.UtcNow()

Basically get the UTC Time and offset that based on the timezone you are interested in.

Answered By – Daniel Elliott

Answer Checked By – Timothy Miller (BugsFixing Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *