Unix Timestamp in Perl
Look up the current epoch time and convert between Unix seconds and UTC dates in Perl.
Get the current timestamp
print time(), "\n";Timestamp to date
use POSIX qw(strftime);
print strftime("%Y-%m-%dT%H:%M:%SZ", gmtime(1700000000)), "\n";Date to timestamp
use Time::Local qw(timegm_modern);
print timegm_modern(20, 13, 22, 14, 10, 2023), "\n";Open 1700000000 in the converter
Current Unix time
Seconds—
Milliseconds—
- UTC
- —
- My time zone
- —
Free to use. Your input stays in this browser.
How to use it
- Copy the current-time example into your Perl environment to read Unix seconds.
- Run the second example to display 1700000000 as a UTC date.
- Run the last example to convert that date back into seconds.
gmtime uses a zero-based month and a year offset of 1900 in list context. Use timegm_modern with a four-digit year for explicit UTC construction.