Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

How to change thhe date format during imports?

Quote Reply
How to change thhe date format during imports?
I have my database in Access and am unable to get it sucessfully in to Links SQL. This upsetting is going on since three months.

Can some one tell me how to get 01.01.99 to 1999-01-01 in the unix format.

I checked the Resources and also the other forums. But they all gives support on new date to unixdate. So what I need is

if ($table eq 'Links') {
if ($record{'Add_date'} !~ /^\d*$/) {
$record{'Add_date'} = &import_to_unixdate ($record{'Add_date'}) | | ($record{'Add_date'});
}
}

sub import_to_unixdate

my $unixdate = ($record{'Add_date'}) = shift;
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $tz) = localtime $unixdate;
$year = $year + 1900; $mon++;
($mon < 10) and ($mon = "0" . int $mon); ($day < 10) and ($day = "0" . int $day);
return "$year-$mon-$day";
}


Will this work? How do I pass the variable ($record{'Add_date'}) to the $unixdate and change the format as :

(Access date) 01.01.99 >> 1999-01-01 (Unix date)














[This message has been edited by rajani (edited October 30, 1999).]
Subject Author Views Date
Thread How to change thhe date format during imports? dearnet 1970 Oct 29, 1999, 9:56 PM
Post Re: How to change thhe date format during imports?
dearnet 1926 Oct 30, 1999, 10:00 AM
Post Re: How to change thhe date format during imports?
Alex 1920 Nov 1, 1999, 10:26 AM
Post Re: How to change thhe date format during imports?
dearnet 1919 Nov 1, 1999, 8:07 PM