Hi,
I am using the below in a global to show the time of the last link added and it works ok - except it takes the date format from another Links Installation that I have (in another language) - is there a way to tell GT::Date to use a specific Date definition. (I am talking about the definition of the weeksdays, months etc in the setup)
lib->import('/path/to/admin');
require GT::SQL;
my $search_db = GT::SQL->new('/path/to/admin/defs')->table('Links');
my ($output,$sth,$link);
$search_db->select_options ('ORDER BY Add_Time DESC Limit 1');
$sth = $search_db->select ( { isValidated => 'Yes' });
while (my $link = $sth->fetchrow_hashref) {
$output = $link->{Add_Time} = GT::Date::date_transform ($link->{Add_Time}, "%yyyy%-%mm%-%dd% %HH%:%MM%:%ss%", "%dddd%, %mmmm% %dd% at %HH%:%MM%" );
}
return $output;
}
http://www.ameinfo.com
I am using the below in a global to show the time of the last link added and it works ok - except it takes the date format from another Links Installation that I have (in another language) - is there a way to tell GT::Date to use a specific Date definition. (I am talking about the definition of the weeksdays, months etc in the setup)
Code:
sub { lib->import('/path/to/admin');
require GT::SQL;
my $search_db = GT::SQL->new('/path/to/admin/defs')->table('Links');
my ($output,$sth,$link);
$search_db->select_options ('ORDER BY Add_Time DESC Limit 1');
$sth = $search_db->select ( { isValidated => 'Yes' });
while (my $link = $sth->fetchrow_hashref) {
$output = $link->{Add_Time} = GT::Date::date_transform ($link->{Add_Time}, "%yyyy%-%mm%-%dd% %HH%:%MM%:%ss%", "%dddd%, %mmmm% %dd% at %HH%:%MM%" );
}
return $output;
}
http://www.ameinfo.com