国产精品网站在线观看免费传媒,国产强被迫伦姧无码,欧 国产成人欧美一区二区三区vr_制服丝袜在线日韩_丝瓜

VB轉(zhuǎn)換UNIX時(shí)間戳的方法

2015/2/7 17:56:113197 閱讀

    UNIX時(shí)間戳為:Utime
    那么時(shí)區(qū)為0即為:
    DateAdd("s",Utime, "1970-1-1 0:0:0")
    北京時(shí)間即為:
    DateAdd("h",8,DateAdd("s",Utime, "1970-1-1 0:0:0"))

    標(biāo)準(zhǔn)函數(shù):
    '把UNIX時(shí)間戳轉(zhuǎn)換為標(biāo)準(zhǔn)時(shí)間
    '參數(shù):intTime:要轉(zhuǎn)換的UNIX時(shí)間戳;intTimeZone:該時(shí)間戳對(duì)應(yīng)的時(shí)區(qū)
    '返回值:intTime所代表的標(biāo)準(zhǔn)時(shí)間
    '示例:FromUnixTime("1211511060", +8),返回值北京時(shí)間2008-5-23 10:51:0

    Function FromUnixTime(intTime, intTimeZone)
        If IsEmpty(intTime) Or Not IsNumeric(intTime) Then
             FromUnixTime = Now()
            Exit Function
        End If
        If IsEmpty(intTime) Or Not IsNumeric(intTimeZone) Then intTimeZone = 0
         FromUnixTime = DateAdd("s", intTime, "1970-1-1 0:0:0")
         FromUnixTime = DateAdd("h", intTimeZone, FromUnixTime)
    End Function
    


    PS:
    Unix時(shí)間戳

    Unix時(shí)間戳是從1970年1月1日 00:00:00開(kāi)始所經(jīng)過(guò)的秒數(shù),不考慮閏秒。
    一個(gè)小時(shí)表示為UNIX時(shí)間戳格式為:3600秒;一天表示為UNIX時(shí)間戳為86400秒,閏秒不計(jì)算。在大多數(shù)的UNIX系統(tǒng)中UNIX時(shí)間戳存儲(chǔ)為32位。

    下一條:kindeditor支持flv視頻播放方法

    上一條:一個(gè)僅保留圖片src的函數(shù)

棗莊西橋網(wǎng)絡(luò)微信小程序微信小程序

棗莊西橋網(wǎng)絡(luò)手機(jī)站二維碼掃描手機(jī)瀏覽