如何用选定的时区显示当前时间?

时间:2009-10-06 13:31:36

标签: asp-classic vbscript

如何用选定的时区而不是服务器TZ显示当前时间? (VB)

2 个答案:

答案 0 :(得分:0)

使用任何TZ;只需使用此行添加小时数:

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

答案 1 :(得分:-1)

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