Getting current time of a different timezone using C++

后端 未结 4 1141
刺人心
刺人心 2021-01-05 05:17

How do i get the current time of a different time zone? Example, i need to know the current time in Singapore where as my system is set to PT time.

4条回答
  •  暖寄归人
    2021-01-05 06:18

    Use UTC (GMT) as much as possible.

    If you need to (for example) print a report that's going to another time zone, use something like SystemTimeToTzSpecificLocalTime() to localise it.

提交回复
热议问题