I'm having an issue that I'm having a hard time to figure out, which is the result of DateTime.UtcNow
. In My local machine when I print it gives me the right time, but in my server it's 3 hours ahead. This is how I'm printing, in a Razor view:
<h1>@DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss")</h1>
What can I check to make this give me the right time?
Thanks for any help
Your server is set to the wrong time. Windows keeps the hardware clock set to local time so if the time is wrong in comparison to the timezone, that essentially means the system clock is not synchronized with UTC time.
If your timezone is set to Chicago timezone, the time on the system tray must also match Chicago time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With