ASP時間戳函數'把標準時間轉換為UNIX時間戳
FunctionToUnixTime(strTime,intTimeZone)IfIsEmpty(strTime)orNotIsDate(strTime)ThenstrTime=NowIfIsEmpty(intTimeZone)orNotisNumeric(intTimeZone)ThenintTimeZone=0ToUnixTime=DateAdd("h",-intTimeZone,strTime)ToUnixTime=DateDiff("s","1970-01-0100:00:00",ToUnixTime)EndFunction'把UNIX時間戳轉換為標準時間FunctionFromUnixTime(intTime,intTimeZone)IfIsEmpty(intTime)orNotIsNumeric(intTime)ThenFromUnixTime=Now()ExitFunctionEndIfIfIsEmpty(intTime)orNotIsNumeric(intTimeZone)ThenintTimeZone=0FromUnixTime=DateAdd("s",intTime,"1970-01-0100:00:00")FromUnixTime=DateAdd("h",intTimeZone,FromUnixTime)EndFunction'調用方法:'示例:ToUnixTime("2009-12-0512:52:25",+8),返回值為1259988745'response.WriteToUnixTime("2009-12-0512:52:25",+8)'示例:FromUnixTime("1259988745",+8),返回值2009-12-0512:52:25'response.WriteFromUnixTime("1259988745",+8)轉載來源網絡