Add a new date format

Last updated on
30 April 2025

Moved here from comments posted on front page:

Custom Formatted Date Display

Posted by ethos_bass on January 11, 2011 at 3:23pm

I'm sorry if this is the wrong place to post a comment / question such as this. I'm new to Drupal and am slowly getting familiar with both the software and community.

I'm looking for documentation regarding custom formats for the output of the datetime field. I can find the .../admin/settings/date-time/formats screen, where I can change the format of the defaults, but I'd like to add a few options to the list of format possibilities. Specifically I'd like an output option of 'time' only (i.e. "4:45pm" vs. "Tuesday January 11th 2011 4:45pm").

If someone can link a discussion on this, I would appreciate it. Or, perhaps, explain briefly where I can poke into the PHP code and create a custom date format (I'm comfortable with ISO date formats and editing PHP code, etc...)

Thank you, in advance, for your help.

time only format

Posted by ancym on February 8, 2011 at 5:49pm

You probably already found this, but just in case

Check Arlin Sandbulte's tutorial on Drupal Calendar Setup
http://vimeo.com/6544779
about 16-17 min in -

go to admin/settings/date-time/formats/add

string is g:ia

(g for 12 hour format, i as minutes place holder, a for am or pm)

Or in Karen S talk about 29 min in here: http://www.doitwithdrupal.com/2009/sessions/dates-calendars-drupal

Help improve this page

Page status: Not set

You can: