Hello Anonymous Monk,
As the other fellow Anonymous Monk suggested you can use stat to get the file information and then from there you can print the date into human readable form with Date::Manip.
Sample of code:
#!/usr/bin/perl use strict; use warnings; use Date::Manip; my $filename = 'test.log'; my $epochSecs = (stat($filename))[9]; print "Date: " . UnixDate( ParseDateString("epoch $epochSecs"), "%Y-%m +-%d %T" ) . "\n";
The module Date::Manip is compatible with you Perl version, if you can install it will run on Solaris 10. Solaris 10 runs on perl 5.8.4 ref perl 5.8.4 package for solaris 10.
Hope this helps, BR.
In reply to Re: Date to Epoch
by thanos1983
in thread Date to Epoch
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |