This is probably something really simple that I'm missing, but I was
wondering if there is some way to get SQL to return a date field in the same
format as Perl's time() or localtime().  Right now I keep getting a string
like this:  "1/20/2003  10:37:17 AM", which doesn't help me when it comes to
calculating dates or scanning through an excel spreadsheet, etc.

Here's a little bit of my code:

#############################################

use strict;
use DBI;
use warnings;
no warnings qw(uninitialized);

my $SQLdbh = DBI->connect("dbi:ODBC:Sys_Trackit",'','')|| die
"$DBI::errstr\n";
my $sth = $SQLdbh->prepare(qq{SELECT * FROM TASKS}) || die "$DBI::errstr\n";
$sth->execute();

while(my $ref = $sth->fetchrow_hashref()){
        $open_date = $ref->{OPENDATE};
        $close_date = $ref->{CLSDDATE};
        #do something
}

#############################################

and yes, for those of you that recognize it, I am using TrackIt.  It's
awful, but it's all I've got.

Reply via email to