Created
October 18, 2019 06:25
-
-
Save easternnl/e14289ddeca1ee18fc40fe2f0d0fba78 to your computer and use it in GitHub Desktop.
Working with milliseconds if the perl library does not support it https://stackoverflow.com/a/18101550
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use Time::HiRes qw(time); | |
| use POSIX qw(strftime); | |
| my $t = time; | |
| my $date = strftime "%Y%m%d %H:%M:%S", localtime $t; | |
| $date .= sprintf ".%03d", ($t-int($t))*1000; # without rounding | |
| print $date, "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment