how to display current time with chosen timezone?

安稳与你 提交于 2019-12-12 05:39:58

问题


how to display current time with chosen timezone instead of server TZ? (VB)


回答1:


to use any TZ; simply use this row to add hours:

anytime = DateAdd("H", HOUR_DIFFERENCE, Now())



回答2:


Public Declare Function GetTimeZoneInformation Lib "kernel32" Alias 
"GetTimeZoneInformation" (lpTimeZoneInformation As 
TIME_ZONE_INFORMATION) As Long 

Public Type TIME_ZONE_INFORMATION 
Bias As Long 
StandardName(32) As Integer 
StandardDate As SYSTEMTIME 
StandardBias As Long 
DaylightName(32) As Integer 
DaylightDate As SYSTEMTIME 
DaylightBias As Long 
End Type 

GMT = systemtime + bias 


来源:https://stackoverflow.com/questions/1525615/how-to-display-current-time-with-chosen-timezone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!