用CDate函数和Format函数
下面有例子
Dim dblTime As Double
    
    '取得当前时间
    dblTime = Now
    
    '格式化显示
    MsgBox Format(CDate(dblTime), "yyyy-mm-dd hh:mm:ss")

解决方案 »

  1.   

    MoQi_123(老莫的春天)
      不对,你的dblTime =Now 的整数,和我的秒计数,不同。我的秒计数算出来有可能是几个月的某一天的日期,我记得在c语言里有一个时间函数可以将相对于1970年1月1日的秒计数换算成为日期,微机是相对于1980年1月1日0分0秒
      

  2.   

    Private Function GetTime(lngTimeAdd As Long) As Date
        GetTime = Format(CDate(DateAdd("s", lngTimeAdd, Format("1980-01-01 00:00:00", "yyyy-mm-dd hh:mm:ss"))), "yyyy-mm-dd hh:mm:ss")
    End FunctionPrivate Sub Form_Load()
        Dim lngTimeAdd As Long
        
        lngTimeAdd = 719080887
        Debug.Print GetTime(lngTimeAdd)
    End Sub
      

  3.   

    结果与你说的结果差几个小时:)?format(clng(719080887)/(clng(24)*clng(3600))+format("1980-01-01 00:00:00","0.0000000"),"yyyy-mm-dd hh:mm:ss")
    2002-10-14 16:41:27
      

  4.   

    print dateadd("s",719080887,"cdate("1980-1-1 0:0:0"))
      

  5.   

    print dateadd("s",719080887,cdate("1980-1-1 0:0:0"))