Ever had to fix auto-generated dates retrieved from MySql databases?
I made a really quick fix that displays the date in "human readable" format.
Just replace "CST" with GMT, or EST etc...
Whatever time zone your mysql server is located.
it takes one argument, the date from the database.
Usage:
use strict;
use DBI;
my $dbh = DBI->connect("DBI:mysql:schemaName", "user", "password")|| die "Error: $DBI::errstr";
my $results = $dbh->fetchall_arrayref(qq~SELECT date FROM table~);
for(@{$results}){
print &fixDate($_[0])."\n"; # See below for subroutine...
}
$dbh->disconnect;
Possible output:
09/05/2008 09:15pm CST
09/02/2008 11:35am CST
etc...