Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [deadroot] Invalid date when importing from Links 2.0

Quote Reply
Re: [deadroot] Invalid date when importing from Links 2.0 In reply to
convert_date function awaits this format: 08-Jan-2000
and returns this format: 2000-01-08
Your date format is: 08-01-2000

So you need to reverse it. In L2S2.pm, within the import() function, do the following changes.

Around line 510 replace this:
Code:
$date = convert_date($date) or warning("Invalid date for link with ID $id. Link skipped."),next;
to
Code:
# $date = convert_date($date) or warning("Invalid date for link with ID $id. Link skipped."),next;
my (@xdate) = split /-/, $in, 3;
$date = join "-", reverse @xdate;



Around line 619 replace this:

Code:
$date = convert_date($date) or warning("Invalid date `$date' for link with ID $id. Link skipped."),next;
to
Code:
#$date = convert_date($date) or warning("Invalid date `$date' for link with ID $id. Link skipped."),next;
my (@xdate) = split /-/, $in, 3;
$date = join "-", reverse @xdate;


Note, I did not try the code.
But logically it should work.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Subject Author Views Date
Thread Invalid date when importing from Links 2.0 DeadMan 1915 Apr 16, 2003, 11:31 AM
Post Re: [deadroot] Invalid date when importing from Links 2.0
webmaster33 1852 Apr 20, 2003, 4:26 AM
Thread Re: [deadroot] Invalid date when importing from Links 2.0
Paul 1854 Apr 20, 2003, 5:15 AM
Thread Re: [Paul] Invalid date when importing from Links 2.0
DeadMan 1846 Apr 20, 2003, 8:20 AM
Thread Re: [deadroot] Invalid date when importing from Links 2.0
webmaster33 1840 Apr 20, 2003, 8:26 AM
Thread Re: [webmaster33] Invalid date when importing from Links 2.0
DeadMan 1839 Apr 20, 2003, 2:54 PM
Post Re: [deadroot] Invalid date when importing from Links 2.0
webmaster33 1834 Apr 20, 2003, 2:57 PM