[removed] Convert a UTC Date() object to the local timezone

前端 未结 4 762
醉酒成梦
醉酒成梦 2021-01-18 13:20

I have a Date() object that contains a UTC date, which I need converted to the users local timezone. Does anybody know how I could do this? :-)

4条回答
  •  北荒
    北荒 (楼主)
    2021-01-18 14:11

    This is an old thread, but just in case anyone else stumbles across this issue, here's how I got around this problem.

    UTC dates from ASP.Net

    In my example, I wanted my ASP.Net service to return dates in the user's local timezone, even though the date values were stored in SQL Server in the UTC timezone.

提交回复
热议问题