2009年9月15日星期二

[PerlChina] Re: 请教个关于时间的问题

http://perldoc.perl.org/functions/time.html


time

  • time

    Returns the number of non-leap seconds since whatever time the system considers to be the epoch, suitable for feeding to gmtime and localtime. On most systems the epoch is 00:00:00 UTC, January 1, 1970; a prominent exception being Mac OS Classic which uses 00:00:00, January 1, 1904 in the current local time zone for its epoch.

    For measuring time in better granularity than one second, you may use either the Time::HiRes module (from CPAN, and starting from Perl 5.8 part of the standard distribution), or if you have gettimeofday(2), you may be able to use the syscall interface of Perl. See perlfaq8 for details.

    For date and time processing look at the many related modules on CPAN. For a comprehensive date and time representation look at the DateTime module.


----------------------------------
msmouse@ir.hit.edu.cn
msmouse@gmail.com


2009/9/15 Uliyas Fan <uliyas@gmail.com>
如果我想得到一个指定时间到1970-1-1日的秒数,应该有什么办法? 比分说想知道2003-5-7 13:50:06 到1970-1-1 00:00:00的秒数。

谢谢




--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

没有评论: