Hi,
Having a problem getting Glinks 3.0.3 to convert the date format from Links 2.0
which is 30-June-2005 to 2005-06-30 which is my date format for GLinks.
Can anyone see why this code is not working!!!
# Converts a date. Returns false if the date is invalid.
sub convert_date ($) {
my $in = shift;
my ($day, $mon, $year) = split /-/, $in, 3;
if ($year and $mon and $day) {
return sprintf("%0d-%0d-%0d", $year, $mon, $day);
}
else {
warning "Invalid date `$in' encountered.";
return;
}
}
I get something like this 2005-00-30 or 2020-00-30
Having a problem getting Glinks 3.0.3 to convert the date format from Links 2.0
which is 30-June-2005 to 2005-06-30 which is my date format for GLinks.
Can anyone see why this code is not working!!!
# Converts a date. Returns false if the date is invalid.
sub convert_date ($) {
my $in = shift;
my ($day, $mon, $year) = split /-/, $in, 3;
if ($year and $mon and $day) {
return sprintf("%0d-%0d-%0d", $year, $mon, $day);
}
else {
warning "Invalid date `$in' encountered.";
return;
}
}
I get something like this 2005-00-30 or 2020-00-30