Gossamer Forum
Quote Reply
user date format
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)


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
Quote Reply
Re: [klauslovgreen] user date format In reply to
This is Gossamer Forum forum ;)

In answer to your question...from your admin panel, click "Help" top right, then scroll down to "GT Module Documentation" and then on the next page click "GT Date". Then look for "Setting date format" Smile
Quote Reply
Re: [Paul] user date format In reply to
oops - sorry about that... please feel free to move it...

The problem is not listed there Paul - the problem is that it inherit the user format from another Links installation...?

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] user date format In reply to
>>
The problem is not listed there Paul - the problem is that it inherit the user format from another Links installation...?
<<

If you are setting the format from within your plugin using date_set_format then it should change it to what you want.
Quote Reply
Re: [Paul] user date format In reply to
got it thanks -

Moderator - please move or delete this thread...

Klaus

http://www.ameinfo.com