Get current date time from server and convert it into local time in c#

前端 未结 6 650
一生所求
一生所求 2021-02-04 14:51

Help: I have a server which is having time in GMT-07.00 hours. My local time is GMT+05.30 hours. I need to get current date and time from server and convert this date and time i

6条回答
  •  走了就别回头了
    2021-02-04 15:38

    If your server's clock is set correctly (regardless of time zone), then the first three lines of your own code are exactly correct. The result variable contains the local time in the India time zone.

    Simply omit the last two lines.

提交回复
热议问题