its very likely I'm missing something, but what that something is alludes me. I'm trying to convert epoch seconds to a usable date format, but I'm having no luck at all. I don't want to use localtime() because it gives a huge string that I really can't use. What I'm after is a date formated like this: yyyy-mm-dd
Below is the code I'm working with and the resulting output.
4 use strict;
5 use Time::CTime;
7 my $epochSeconds = time;
9 my $theDate= strftime( '%Y-%M-%d', $epochSeconds );
11 print "The Epoch Seconds are: $epochSeconds
12 print "The Converted Date is: $theDate
The Epoch Seconds are: 1069474375
The Converted Date is: 1900-00-00
As far as I know the epoch seconds shown above is current to when the program ran and is the actual date and time that the program was run.
0 · ·