Gossamer Forum
Quote Reply
Date issue (again)
Hi,

Yet another Date issue...

I have a field called Add_Time in the fomat:
yyyy-mm-dd HH:MM:ss

I tried converting the date to another format on my category pages but it appears that the format is already converted to dddd, mm dd - yyyy at HH:MM somewhere - so I can't convert again using the below:

Code:
<%GT::Date::date_transform ($Add_Time, '%yyyy%-%mm%-%dd% %HH%:%MM%:%ss%', '%dd%/%mm%/%yyyy%')%>

Any suggestions on how I can access the origial format stored in the database and not the current shape of Add_Time?


Thanks in advance
Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] Date issue (again) In reply to
Quote:
how I can access the origial format stored in the database
Get from the database? Wink

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] Date issue (again) In reply to
yes that's what I want - but the value I get when using $Add_Time is a converted format - ie end-user format - not the yyyy-mm-dd

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] Date issue (again) In reply to
Did you check the admin config?
There is a db_format option, and some others which may affect the output...

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] Date issue (again) In reply to
Yes - it seems to be fine - the problem is it works fine on Detailed pages - just not on Category?!?

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] Date issue (again) In reply to
1)
Quote:
seems to be fine
This is the worst possible bug report.
What are exactly in the 3 top field of Date Options?

2) What is the format printed on the Detailed pages?

3) Do you have any plugin installed?

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: [klauslovgreen] Date issue (again) In reply to
Also print the $GT::Date::DATE_FMT variable to see what is the current date format. Post the format to the forum.

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] Date issue (again) In reply to
Hi,

Sorry if it is not clear - here is what I have in the 3 fields:

1. %yyyy%-%mm%-%dd%
2. %dddd%, %mmmm% %dd% - %yyyy%
3. %dddd%, %mmmm% %dd% - %yyyy%

(same order as on the admin page)


Printed format on the page is:
dddd, mm dd - yyyy at HH:MM

I do have plugins - but none that sets the date format - please note this is on a custom field Add_Time and if I look at the database entry it appears as it should - ie yyyy-mm-dd HH:MM:ss

Thanks for your patience
Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] Date issue (again) In reply to
Also print the $GT::Date::DATE_FMT before you call the GT::Date::date_transform () function...
You may see that it's not the same as '%yyyy%-%mm%-%dd% %HH%:%MM%:%ss%' initial format you gave as input parameter...

Let me know the results...

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

Last edited by:

webmaster33: Mar 30, 2003, 6:37 AM
Quote Reply
Re: [webmaster33] Date issue (again) In reply to
Yeps that's the whole problem - the input format is not from the database - but as I listed... so the question is how do I ensure I get the value from the database? Is there a way to reset the format or?

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] Date issue (again) In reply to
Strange. As far as I can tell by looking at the source code it doesn't/shouldn't make any changes to the value of the original date. Is $Add_Date being used in link.html?
Quote Reply
Re: [klauslovgreen] Date issue (again) In reply to
Did you print $GT::Date::DATE_FMT ?
Is it in this format?: dddd, mm dd - yyyy at HH:MM

If yes, there is no problem, use this format as workaround.
You have all the values you need for a successful conversion.

<%GT::Date::date_transform ($Add_Time, '%dddd%, %mm% %dd% - %yyyy% at %HH%:%MM%', '%dd%/%mm%/%yyyy%')%>

However this is just a workaround, because the date format is changed somewhere.
The 'dddd, mm dd - yyyy at HH:MM' format is not common in LSQL, so I suppose it's changed in plugin or a global...
You should do a search within the admin directory in all files, including compressed files, and search for ' at ' string (without quotes).

Hope that helps.

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] Date issue (again) In reply to
Thanks - the workaround did the trick :-)

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] Date issue (again) In reply to
Please note, that if you remove the plugin or global what caused the problem, you will find, that date conversion does not work again!
You should investigate the problem anyway!
Do the search for ' at ' anyway...

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] Date issue (again) In reply to
Will do - thanks again

Klaus

http://www.ameinfo.com