[程序发布]unix时间戳转换1.0 (windows unix通用)(1.0过期,2.0已经发布)

Oct 22nd, 2006

unix时间戳转换1.0 (windows unix通用)

更新:
 增加时间戳转换为系统时间的功能
 修改了算法
 修改了系统时间转换为时间戳的一些问题
 用C++重新编译
 移植到unix系统下(可以在unix系统下运行)
 返回显示菜单


程序运行:
 windows下请执行程序 “winutsc.exe”。unix系统下将”unixtsc” 文件复制到 bin 下。 然后输入指令 unixtsc 。 如果程序发生错误可以 按下 ctrl + c 组合键终止程序。

 另外 unixtsc 我已经在SUSE Linux 10.0 下测试过了。程序不需要调用任何运行库,所以在其他的系统应该不会用问题。 如果有什么错误请和我联系。

 注意时差,国内的主机基本上都是 +8 的时差,也就是说。转换出来需要在加上8小时的时间戳 (也就是 28800 )。本程序的时间差为 +0 。 不同的地方要注意不同的时间差。

[newpage]
一些废话:
 一个多月了,时间是长了些。 本来早就写完了的。 后来开学后学习c++了。 为了练习,就用c++重新写了所有的代码.这样重新测试又花了很长的时间,加上上周发生了很多事情 ~~~>_<~~~ . 不过我在昨天晚上还是将所有的东西都完成了。今天又写了这些文档。

下载:
[file]attachment/200611/1164063655_0.zip[/file]

2006年10月22日 16:30:07 (1161534607)
heston@goodays.com

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • email
  • Fleck
  • Gwar
  • Haohao
  • Identi.ca
  • laaik.it
  • LinkaGoGo
  • LinkedIn
  • Linkter
  • Live
  • MisterWong
  • MisterWong.DE
  • MSN Reporter
  • MySpace
  • PDF
  • Ping.fm
  • RSS
  • Slashdot
  • Socialogs
  • Technorati
  • Tumblr
  • Twitter
  • Twitthis
  • Webride
  • Yahoo! Bookmarks
  • Yigg
Tags:
  1. Vicky
    Aug 12th, 2007 at 14:10
    Reply | Quote | #1

    [emot]08[/emot]这个玩意太好用了。白丁正在这苦恼怎么算日子呢。

  2. 不知为什么
    Nov 25th, 2006 at 02:11
    Reply | Quote | #3

    你好!能告诉我当一个事务采用时间戳协议时,它的具体的执行过程吗?包括read( )各write( )操作。谢谢了!

    • liduan
      Dec 5th, 2006 at 00:10
      Reply | Quote | #4

      老实说,我就是搞不懂时间戳协议该如何使用才写这个程序的。 实在是不知道该怎么回答这个问题,抱歉[emot]03[/emot]

  3. hhl
    Nov 1st, 2006 at 03:36
    Reply | Quote | #5

    楼主,用你的程序转换出来的unix时间戳,不应该+8小时时差吧?
    举个时间:2006-02-14 00:00:00
    我在两个Linux机器(一个公司的,一个自己家中的)上转换出来都是1139846400
    而用你的程序转换出来的是1139875200
    也就是:winutsc – 8小时时差 = linux
    呵呵,这到底是怎么一回事呢,我对这个时差越来越糊涂了。孰对孰错?我需要一个准确的值来操作数据库中的记录。

    • liduan
      Nov 2nd, 2006 at 20:52
      Reply | Quote | #6

      [emot]15[/emot]我已经详细的检查了程序的代码[emot]04[/emot],而且严格的测试过程序。程序本身没有问题。 问题出在我们对于时间差的理解还有我们对程序处理时间差的误解。 我会在周末给出一个详细的解释说明。

  4. Mr. J
    Oct 30th, 2006 at 12:42
    Reply | Quote | #7

    可否提供源代码?共大家学习

    • liduan
      Oct 30th, 2006 at 12:50
      Reply | Quote | #8

      [emot]02[/emot]我整理一下,会公开的。[emot]01[/emot]

  5. hhl
    Oct 30th, 2006 at 07:27
    Reply | Quote | #9

    还有一点,我用国内当地时间进行计算,为什么还要+8个小时的时差呢?

    • liduan
      Oct 30th, 2006 at 11:45

      我现在是在GMT+0的时区, 国内的主机基本上都是GMT+8的时区,也就是说国内数据库里记录的时间戳会在这个软件转换出来的时戳上加上8小时的时戳。 你可以自己测试以下。[emot]15[/emot], 下个版本我会考虑时差的问题。 这个问题也是在我完成后测试时发现的。

  6. hhl
    Oct 30th, 2006 at 07:21

    1、不支持命令行输入;
    2、不支持完整日期格式的输入
    3、输入没有检查验证,比如:输入exit,会不断刷屏"error choice"
    呵呵,工作原因,写一个批处理文件,需要用unix时间戳,可惜没法将你的程序的输出结果调用到批处理,也无法将转换出来的时间戳重定向到一个文件以方便掉用。
    希望楼主再接再厉,搞一个加强版出来。

    • liduan
      Oct 30th, 2006 at 11:41

      一针见血啊[emot]23[/emot], 说得太对了[emot]08[/emot]。这些我都会在下个版本里尽量充分考虑的。 毕竟我也是刚刚开始接触c++,.[emot]09[/emot]

Note: Commenter is allowed to use '@User+blank' to automatically notify your reply to other commenter. e.g, if ABC is one of commenter of this post, then write '@ABC '(exclude ') will automatically send your comment to ABC. Using '@all ' to notify all previous commenters. Be sure that the value of User should exactly match with commenter's name (case sensitive).