0

Perl time function is great, but how do I find the smallest epoch value that's in today? Since epoch is in seconds I would imagine that there are many epoch values that will correspond to a given day. How do I find the lowest in my timezone?

4

1 回答 1

1

不支持使用timelocal,但使用它来获取所需信息应该没有问题。

use Time::Local qw( timelocal );
my $epoch = timelocal(0,0,0, (localtime)[3,4,5]);
  • 我不知道任何一天有两个午夜的时区,所以我无法测试。
  • 我测试了一个没有午夜的时区(2013 年 10 月 20 日在美国/圣保罗),它运行良好。
于 2013-03-25T01:45:37.477 回答