Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
By jnjn on
I haven't been able to google my way out of this one.
What i need is to change the default date formatting for the "Authored on" field to DD/MM/YYYY
Thanks!
Comments
Are you referring to the
Are you referring to the 'submitted by' line?
If so, you may find this helpful:
http://answers.oreilly.com/topic/1512-using-drupals-templatephp-for-over...
_
Shame that Blimey O'Reilly screwed up the php code printing!
The new function in template.php should be
Overrides theme settings
This code is a bit sloppy, as it overrides theme settings which tell Drupal whether to display this at all. So if you are looking at a content type that is not set to display the "Submitted by..." info at all, this will stick it in there, ignoring the settings. The snippet below should respect the setting:
Actually im refering to the
Actually im refering to the field, when you edit/add a new story and click the "authoring information" tab.
There is a field called "Authored on" and below it says "Format: 2010-12-02 19:09:07 +0100"
I would like to have this field be DD/MM/YYYY instead
_
The bit you're referring to is hardcoded in node.pages.inc and so can't be changed - well, it can, but any upgrade will overwrite the change, so hacking core modules is discouraged.
The code above will change the format of the 'Submitted by...' bit when actually viewing the story.
Okay, thanks for the reply.
Okay, thanks for the reply. Think i will just leave it as is then, and used the code posted to output correct format.
Thanks guys =)
The date_popup_authored module provides this capability
If you are coming here from google then changing the format on this field date_popup_authored.