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

xmacinfo’s picture

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

laura s’s picture

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

joar-1’s picture

Thanks to both of you!