Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By joar-1 on
Where can the date formats (long, medium, short) be changed? E.g where can I remove the hour:minutes from the short format? - I know how to do it - but not where. (what line in what file)?
JH
Comments
Manually modifying the date format
Hi!
I hope Drupal 4.8 will have a better way to let a webmaster change the date formats. I think Drupal will offer something, but I'm still looking for a confirmation.
As for 4.7, you must edit the system.module at lines 401 to 411. You need to add a format to the array.
- Jacques
/*_*/
http://www.xmacinfo.com
You can modify date
Do it in the theming. No core hacking necessary.
Best way: change the date format using template.php in your theme folder.
Here's a simple approach I've used in the past:
At the top of your node.tpl.php file, add:
$formatted_date = format_date($node->created, 'custom', 'D j M Y');
(change the date details to your taste)
Then print or echo $formatted_date instead of $date.
Laura
_____ ____ ___ __ _ _
design, snap, blog
_____ ____ ___ __ _ _
Laura Scott :: design » blog » tweet
Ok
Thanks to both of you!