Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

2.2.1 bug in GT::Date::date_get() ?

Quote Reply
2.2.1 bug in GT::Date::date_get() ?
Hi guys,

I'm using the following;

Code:
my $today = GT::Date->date_get();

.. but it keeps giving me;

Quote:
today: Thu Jan 01 1970

Anyone got any ideas? :|

TIA

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] 2.2.1 bug in GT::Date::date_get() ? In reply to
Interesting.

In LSQL v2.2.1, the date_get() has this first line:
Code:
my $time = shift || time;
So there is no bug in GT::Date, IMHO. (Version: $Id: Date.pm,v 1.74 2004/03/18 22:36:35 alex Exp $).


Try to use this code:
Code:
my $today = GT::Date->date_get(time);

If this is giving the same result, then:
1) you have wrong date set on your server. Set it.
or
2) your Linux installation is damaged
Try to copy a fresh time binary if anything else doesn't help.

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] 2.2.1 bug in GT::Date::date_get() ? In reply to
It's not a bug or a damaged installation.

Andy is calling date_get() as a class method, therefore the first argument to date_get is 'GT::Date', hence the code:

my $time = shift || time;

....is setting $time to the string 'GT::Date'. Obviously this is not a valid time and so January 1970 is returned (the beginning of epoch time).

It needs to be called as a function.

my $date = GT::Date::date_get();
Quote Reply
Re: [PAYE] 2.2.1 bug in GT::Date::date_get() ? In reply to
Ah, Paye, you are absolutely right! Cool

I missed the point that Andy was calling it as method! Angelic
Yes,
my $date = GT::Date::date_get();
should work then.

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