perl 转换时间问题
发布网友
发布时间:2022-04-18 23:49
我来回答
共2个回答
懂视网
时间:2022-04-19 04:10
1
热心网友
时间:2022-04-19 01:18
use Time::Local;
$t ='2015-02-02 10:11:09';
($y, $m, $d, $h, $mi, $s) = $t=~/(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/;
print timelocal($s, $mi, $h, $d, $m-1, $y), "\n";