Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要将时间以毫秒为单位转换为格式的日期:YYYY-mm-dd hh:mm:ss 请帮助
“毫秒”不表示时间,它们表示持续时间。听起来你有一个 unix 纪元时间戳乘以 1000 加上毫秒。
use POSIX qw( strftime ); my $formatted = strftime("%Y-%m-%d %H:%M:%S", localtime($ts/1000));
或者gmtime
gmtime