Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Date Format

Quote Reply
Date Format
I've added a new Date field in my links database and I would like to have the date display using the date formats, like "Jan 12 1999"

The date formats seem to only work on the Add_Date and Mod_Date field, how do I get it to work on my own dates?

Bryan
Quote Reply
Re: [BryanL] Date Format In reply to
I think you can do this using the MySQLMan utility. Go to the Database page in the administration, and select the MySQLMan on the left. After it opens you need to find your Links table from the list and click on Properties for it. Then select Change for the field you want to change the date format, and change the type to Date.

-jw
Quote Reply
Re: [BryanL] Date Format In reply to
Hi,

In your template you can put:

<%GT::Date::date_transform($NewDate, '%yyyy%-%mm%-%dd%', '%mmm% %dd% %yyyy%')%>

Where NewDate is the column you added. That will transform the date from MySQL default of yyyy-mm-dd to your custom format of mmm dd yyyy.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Date Format In reply to
This did the exactly what I wanted:

<%GT::Date::date_transform($NewDate, '%yyyy%-%mm%-%dd%', '%mmm% %dd% %yyyy%')%>

I had searched the forum before posting and I tried this tag: <%GT::Date::transform ($date, 'old format', 'new format')%> but that no longer works, at least in LinksSQL 2.1.

Thanks,