Gossamer Forum
Home : Products : Gossamer Links : Discussions :

BUG nr.1-2: GT::Date::date_transform

Quote Reply
BUG nr.1-2: GT::Date::date_transform
Version: LinksSQL v2.1.0
nr.1) BUG:
Problem:
- using GT::Date::date_transform to convert date format, the %HH% (24 hour format) in input is treated as %hh% (12 hour format) and transformed to %HH% 24 hour format, while the input format was %HH% (24 hour format) and in the output format was %HH% (24 hour format), too.

Example:
Code:
print 'Date: 2002-02-25 12:16:36\n';
print 'Input: %yyyy%-%mm%-%dd% %HH%:%MM%:%ss%\n';
my $date = GT::Date::date_transform ('2002-02-25 12:16:36',
'%yyyy%-%mm%-%dd% %HH%:%MM%:%ss%', '%yyyy%.%mm%.%dd% %HH%:%MM%');
print "Output: $date\n";

nr.2) BUG:
Problem:
- GT::Date has invalid help documentation (\admin\templates\admin\help\GT\Date.html): date_format ($date, $orig_fmt, $new_fmt) for date format change is invalid.
The valid sub for date format change is date_transform ($date, $orig_fmt, $new_fmt).

Please correct the bug (if any), and publicate the corrected Date.pm (maybe the corrected Date.html help file too, if you like) .

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...
Quote Reply
Re: [webmaster33] BUG nr.1-2: GT::Date::date_transform In reply to
Oh, by the way, I forgot the result of the example above which shows the error:
Output: 2002.02.25 00:16

The error is 00:16 time which should be in the same format as original, so should be 12:16.

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...
Quote Reply
Re: [webmaster33] BUG nr.1-2: GT::Date::date_transform In reply to
Hi,

Thanks for the bug posting! Attached is a patch to fix Date.pm.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] BUG nr.1-2: GT::Date::date_transform In reply to
Thank you Alex!
You are really quick! Cool

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...