Currently, I have a lot of operations on my website where I go:
if (auction.StartTime.Value <= DateTime.Now)
Then on my web application's _Layout.cshtml, I display the server time using:
<p id="time">@DateTime.Now.ToString("HH:mm")</p>
This correctly shows me the current server time, but I'd like to display this time according to where the user it. Sure I could do something like:
<p id="time">@DateTime.Now.ToGMT(-4).ToString("HH:mm")</p>
But this is maintanance nightmare. I'd have to set this GMT extension method everywhere. Maybe there's something cooked into the .NET framework?
How would you recommend I handle this?