下面是我的ASP(ASP.NET不)代碼:經典顯示IST(印度標準時間)ASP
<%
days = day(now)
if len(days) <> 2 then
days = "0"&days
END IF
months = month(now)
if len(months) <> 2 then
months ="0"&months
end if
min = dateadd("n",2,now)
hr = dateadd("h",-5,now)
Hrs = hour(hr)
if len(Hrs) <> 2 then
Hrs ="0"&Hrs
end if
Mins = minute(min)
if len(Mins) <> 2 then
Mins ="0"&Mins
end if
Secs = second(now)
if len(Secs) <> 2 then
Secs ="0"&Secs
end if
datess = year(now)&"-"&months&"-"&days&"T"&Hrs&":"&Mins&":"&Secs
response.write(datess) %>
輸出是服務器時間(服務器託管UK)。現在我想將其轉換爲IST(印度標準時間)。我如何在Classic ASP中做到這一點?
邏輯說,你應該採用UTC時間,並根據時區爲UTC時間添加時間,例如我估計IST爲5:30小時。 – yogi