How do I remove the year from my link.html insert <%Date%> so that links only read 14-Feb etc?
Feb 25, 2000, 3:51 AM
User (68 posts)
Feb 25, 2000, 3:51 AM
Post #2 of 3
Views: 826
Brian,
There is a FAQ in the Resource Center that talks about how to change the date formats. The URL is http://www.gossamer-threads.com/...es/Detailed/325.html
There are two date routines located in links.cfg. They are called date_to_unix and unit_to_date. You should just have to modify unit to date.
Original code:
to
I have not tested this change, but it looks pretty simple
Frank
------------------
Webmasters Resources
http://www.webmasters-resources.com/
There is a FAQ in the Resource Center that talks about how to change the date formats. The URL is http://www.gossamer-threads.com/...es/Detailed/325.html
There are two date routines located in links.cfg. They are called date_to_unix and unit_to_date. You should just have to modify unit to date.
Original code:
Code:
return "$day-$month[$mon]-$year";to
Code:
return "$day-$month[$mon]";I have not tested this change, but it looks pretty simple

Frank
------------------
Webmasters Resources
http://www.webmasters-resources.com/
Feb 25, 2000, 4:04 AM
User (431 posts)
Feb 25, 2000, 4:04 AM
Post #3 of 3
Views: 830
The solution I'm gonna provide will only modify the way the date is displayed locally, not globally... though Frank's way looks fine, too...
In sub site_html_link in site_html_templates, add right before return &load_template...
$shortdate =~ s/(\w+-\w+)-\w+/$1/;and then in return &load_template before %rec, add...
In your link.html template, use <%shortDate%> instead of <%Date%>...
One other piece of advice... if you are at all serious about learning Perl to customize your code/site, pick up a good book on regular expressions. I've said it before, but I'd estimate that over 80% of the mods I do are mainly regex related...
------------------
The Immuatable Order of Modding
-=-=-=-=-=-=-=-
1. Read the FAQ, 2. Search the board, 2a. Search the board again, 3. ask the question, 4. back-up, 5. experiment, 6. rephrase question (or better yet, post solution to original question)
[This message has been edited by oldmoney (edited February 25, 2000).]
In sub site_html_link in site_html_templates, add right before return &load_template...
Code:
my $shortdate = $rec{'Date'}; $shortdate =~ s/(\w+-\w+)-\w+/$1/;
Code:
shortDate => $shortdate,One other piece of advice... if you are at all serious about learning Perl to customize your code/site, pick up a good book on regular expressions. I've said it before, but I'd estimate that over 80% of the mods I do are mainly regex related...
------------------
The Immuatable Order of Modding
-=-=-=-=-=-=-=-
1. Read the FAQ, 2. Search the board, 2a. Search the board again, 3. ask the question, 4. back-up, 5. experiment, 6. rephrase question (or better yet, post solution to original question)
[This message has been edited by oldmoney (edited February 25, 2000).]