Drupal 7 Tutorial: How to add a Custom Date Format

By default, Drupal only offers three types of date formats. Long, Medium and Short.


In this tutorial we are going to add our own: 30Jul14

First, go to


Click Add Format

Under the ‘Format String’ entry box, click the ‘Php Manual’ link where it says ‘see the PHP Manual for available options’ (make sure to open it in another window to avoid losing your current page.)


It will lead you to http://php.net/manual/en/function.date.php , the PHP page for characters recognized in php’s format parameter string. Look for the format specific to what you want, which in my case is:

d – Day of the month, 2 digits with leading zeros – 01 to 31
M – A short textual representation of a month, three letters – Jan through Dec
y – A two digit representation of a year – Examples: 99 or 03

place that string in the ‘format string’ entry box:


Click Add Format, and you will now have a new format to use. But before you can use it you will need to give it a name. Click the ‘Types‘ TAB, then click ‘Add Date Type‘.

Give it a descriptive name, such as the actual result itself you want. In my case, 30jul14.


Save it.

You now have custom date format.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.