2009年2月14日是 早上7:30:30,是UNIX时间从1970年1月1算起的第1234567890秒, 是个大日子, 好好庆祝下

Crob 2009-02-13 09:39:14
int main()
{
time_t now;
time(&now);

long diff = 1234567890 - now;

cout < < "current: " < < now < < endl;
cout < < "till 1234567890 we have:" < < endl;
cout < < diff < < " secs" < < endl;
cout < < diff / 60.0 < < " minutes" < < endl;
cout < < diff / 3600.0 < < " hours" < < endl;

cout < < endl;
long lnow = 1234567890;
tm* tnow;
tnow = localtime(&lnow);
cout < < tnow->tm_year + 1900 < < "-" < < tnow->tm_mon + 1 < < "-" < < tnow->tm_mday < < " " < < tnow->tm_hour < < ":" < < tnow->tm_min < < ":" < < tnow->tm_sec;

return 0;
}

----------------
Unix weenies everywhere will be partying like it’s 1234567890 this Friday.

That’s because, at precisely 3:31:30 p.m. Pacific time on February 13, 2009, the 10-digit “epoch time” clock used by most Unix computers will display all ten decimal digits in sequence. (That’s 6:31:30 Eastern, or 23:31:30 UTC.)

Unlike time systems intended for humans, Unix time simply counts the number of seconds since midnight UTC on January 1, 1970. It’s a convenient way for computers to measure elapsed time, provided the start date wasn’t before 1970. On Friday, the number of seconds will hit 1,234,567,890. Celebrations are planned in San Francisco, Vancouver, Seattle, Los Angeles and about 10 other locations worldwide, so don’t be surprised if it takes the guys in IT a little longer to respond to your calls tomorrow afternoon, or if the Gadget Lab crew is hard to find.

We couldn’t find any watches that display Unix time, but the above desk clock from ThinkGeek, will do the trick. It will also display the time in binary, octal, hexadecimal or Roman formats. Mark your calendars: It’s only 11 and a half years until XX:XX:XX X/XX/XX day.
...全文
138 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
qiqiqiluo 2009-02-13
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 baihacker 的回复:]
upup
[/Quote]

UPUP
baihacker 2009-02-13
  • 打赏
  • 举报
回复
upup
yutaooo 2009-02-13
  • 打赏
  • 举报
回复

喔~~~
nkym0626 2009-02-13
  • 打赏
  • 举报
回复
SF
  • 打赏
  • 举报
回复
.....
Crob 2009-02-13
  • 打赏
  • 举报
回复
随手写的,在Linux下可以用下面命令直接查看
date -d @1234567890
ch1oE 2009-02-13
  • 打赏
  • 举报
回复


#include <locale>

using namespace std;

int main()
{

time_t now;
time(&now);

long diff = 1234567890 - now;

cout << "current: " << now << endl;
cout << "till 1234567890 we have:" << endl;
cout << diff << "secs" << endl;
cout << diff / 60.0 << " minutes" << endl;
cout << diff / 3600.0 << " hours" << endl;

cout << endl;
time_t lnow = 1234567890;
tm* tnow;
tnow = localtime(&lnow);
cout << tnow->tm_year + 1900 << "-" << tnow->tm_mon + 1 << "-" << tnow->tm_mday << " " << tnow->tm_hour << ":" << tnow->tm_min << ":" << tnow->tm_sec;


return 0;
}



以上代码copy就可以运行(LZ的少了点头文件以及强转的问题~)

俺们这边输出的结果是:
current: 1234501808
till 1234567890 we have:
66082secs
1101.37 minutes
18.3561 hours

2009-2-14 7:31:30

期待啊~~~~~
laomai 2009-02-13
  • 打赏
  • 举报
回复
不错

15,440

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧