![]() |
1
4
基于UTC,epochtime只有一个标准定义,而不同时区没有不同的epochtime。 如果你想找到 offset between gmtime and localtime 使用
|
![]() |
2
6
|
![]() |
3
2
你只需要设定时区。尝试: env TZ=UTC+1 perl -e 'use Time::Local; print timelocal("00","00","00","01","01","2000"),"\n";' |
![]() |
4
2
$ perl -MTime::Local -le \ 'print scalar localtime timelocal "00","00","00","01","01","2000"' Tue Feb 1 00:00:00 2000
你想要
$ perl -MTime::Local' -le \ 'print scalar gmtime timelocal "00","00","00","01","01","2000"' Mon Jan 31 23:00:00 2000
你想换个方向吗?
$ perl -MTime::Local -le \ 'print scalar localtime timegm "00","00","00","01","01","2000"' Tue Feb 1 01:00:00 2000 |
![]() |
5
2
虽然时间::本地是一个合理的解决方案,但最好使用更现代的面向对象的datetime模块。下面是一个例子:
对于时区,可以使用datetime::timezone模块。
CPAN链接: |
![]() |
6
0
另一个基于 DateTime::Format::Strptime
|
![]() |
Radhika Kandasamy · 在文本文件中的行首添加一个单词 7 年前 |
![]() |
charpi · 安装旧版本的Emacs(19.34) 7 年前 |
![]() |
Van Peer · 查询tar和。快照目录 7 年前 |
![]() |
kvway · 最后在awk中运行[Solaris] 9 年前 |
![]() |
BKF · Unix:如何从磁带中恢复损坏的tar文件 9 年前 |
![]() |
Bad_Coder · 如何在solaris上获得完整的启动时间 10 年前 |