关于时间转换

十二 14th, 2009

1. 在excel里显示time_t类型的时间(1970-1-1到现在的秒数):  设数字在B1格中,先输入工式: =(E1+8*3600)/(24*3600)+25569,然后设置单元格选项为日期类型即可。

2. 得到当前的time_t秒数,这在程序中很容易,在linux命令下,可以用 data +%s 命令得到。

3. 在linux命令行下把数值转化为时间: 设目前秒数是1260796354,则命令为:
data -d @1260796354

当然,这些都是命令行或软件使用中的。在程序中,那是非常方便的转换。

标签:
  1. Blue
    十二 22nd, 201109:55

    Sounds a cool ideas and seems too interesting to take a short cut on calculation process and I love this input of work.

  2. Buy Facebook Fans
    十二 27th, 201118:44
    #2
*