再c语言里面可以如下:
long nn=1040000000;
StartTime = localtime(  &nn);
printf( "The start time are: %s", asctime(StartTime ) );
请问vb 里面怎么解决啊

解决方案 »

  1.   

    Text1.Text = Format(Text1.Text, "##:##:##:####")
      

  2.   

    format函数可以转成任意格式的形式!
      

  3.   

    dim lx as long
    dim sx as string 
      lx=1000000
      sx=cstr(lx)
      

  4.   

    大哥谁用那个数据给我用format写一个试试好吗?我试了总是益处
      

  5.   

    你先要搞清楚localtime() 返回的是什么类型..
    C++里是 tm 结构.也就不是单纯的一个 时间.
    而asctime() 返回的格式 应该是 星期几 年/月/日 时间(hh:mm:ss)
    format 不能直接这样格式出来时间Private Function GetTime(nn As Long) As String
    Dim Date_T As Date
    '这里有个问题要注意.
    '我查了一下localtime()函数,他说是从1970/1/1 00:00:00 开始计算时间的
    '但我用C++,上面的例子 输入nn=0 结果返回的是1970/1/1 08:00:00
    '结果多了8个小时,我不知道什么原因,所以我下面是用1970/1/1 8点开始计算的
    'Date_T = DateAdd("s", nn, #1/1/1970 00:00:00 AM#)
    Date_T = DateAdd("s", nn, #1/1/1970 8:00:00 AM#)
    'Date_T返回的是一个日期型的时间
    '这里可以用Format函数来格式化输出了
    '我使用的格式是你上面asctime() 的格式
    GetTime = Format(date1, "ddd mmm dd hh:mm:ss")
    End Function
      

  6.   

    GetTime = Format(date1, "ddd mmm dd hh:mm:ss")
    这句写错了应该是
    GetTime = Format(Date_T, "ddd mmm dd hh:mm:ss")
      

  7.   

    cdate() 不能用这么大的数,会益处的
    怎么还不结贴啊。。
      

  8.   

    建议你装个msdn或下个帮助实在不行vb5的help文件里也可以,format()函数的详细解释,一看就明白,好像还有这么个例子不过是integer型转的,差不多的!
      

  9.   

    Private Sub Command1_Click()
        Dim lx As Long
        Dim sx As String
        lx = 1040000000
        MsgBox Format(lx, "##:##:##:####")
    End Sub
      

  10.   

    不文才是真正的高手,其他人都不看要求,让人faint掉
      

  11.   

    localtime的msdn中说的是国际标准时间,和北京时间差8个小时