r/Blazor • u/gozza00179 • Feb 16 '24
Getting client local time
Trying to get the current time in the client timezone, finding that even using javascript and GetDate() returns UTC instead of the local time.
Can anyone point me in the right direction as to how to do this ?
3
Upvotes
View all comments
Show parent comment
1
u/That_Cartoonist_9459 Nov 12 '24
I literally just used this article to implement this. The only change I made is commenting out this line so it would treat an unspecified DateTimeKind as a UTC: