'時間戳常量
private const timezone_china as long = &h8 '中國(北京)時區[東八區]
private const timestamp_max as date = #1/19/2038 11:14:07 am# '時間戳最大值(&h7fffffff)
private const timestamp_min as date = #12/14/1901 4:45:52 am# '時間戳最小值(&h80000000)
'日期格式轉時間戳,預設加上東八區(北京時間)的時差
public function timestampfromdate(optional timestamp as date, optional timezone as long = timezone_china) as long
dim datetimestamp as date
if timestamp > timestamp_max or timestamp < timestamp_min then timestamp = now
datetimestamp = dateadd("h", -timezone, timestamp)
timestampfromdate = datediff("s", timestamp_base, datetimestamp)
end function
'時間戳轉日期格式,預設除去東八區(北京時間)的時差
public function timestamptodate(timestamp as long, optional timezone as long = timezone_china) as date
dim datetimestamp as date
datetimestamp = dateadd("s", timestamp, timestamp_base)
timestamptodate = dateadd("h", timezone, datetimestamp)
end function
private sub form_load()
debug.print "timestamptest", timestampfromdate(now), timestamptodate(timestampfromdate(now))
unload me
end sub
零點時間戳
一開始在csdn找的 long zero system.currenttimemillis 1000 3600 24 1000 3600 24 timezone.getdefault getrawoffset system.currenttimemillis 1000 3600 24 獲取當前時間後...
DB2時間戳檢視
1.開啟日誌,確定錯誤是那個資料庫操作造成 2.檢視bnd檔案的時間戳資訊 db2bfd b card.bnd grep timestamp 顯示時間戳 timestamp ta5mpfmz 2009 12 31 15 12 56 45 3.檢視已bind時間戳 1 db2expln d testd...
007 時間戳和正常時間格式間的轉換
python中時間的儲存格式 time.struct time tm year 2018,tm mon 8,tm mday 16,tm hour 10,tm min 13,tm sec 13,tm wday 3,tm yday 228,tm isdst 0 時間戳,根據1970年1月1日00 00 ...