How to get the epoch timestamp in Perl?

In Perl, how to get the epoch timestamp, the number of seconds passed since the epoch?

In Perl, to get the epoch time, call the time function:

my $ts = time

Example:

$ perl -e 'print time . "n"'
1491473202
Leave a Reply

Your email address will not be published. Required fields are marked *