format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL)
Drupal API: https://api.drupal.org/api/drupal/includes%21common.inc/function/format_date/7
Custom formats
In case of a custom format, please check out our two following examples. Please note also that the $timestamp parameter should be a UNIX timestamp.- If you have added to your content type (for example) the field_event_date with Date (Unix timestamp), you should use the function format_date as follows in your node template:
format_date($node-> field_event_date['und'][0]['value'], 'custom', 'D, d M Y');
- If you have added to your content type (for example) the field_event_date with Date (ISO format), you should use the function format_date as follows in your node template:
format_date(strtotime($node-> field_event_date['und'][0]['value']), 'custom', 'D, d M Y');
Regrading the PHP date formats 'D, d M Y', please check this documentation page http://www.php.net/manual/en/datetime.formats.date.php
In case this article leaves any of your questions or concerns unanswered, please feel welcome to email us or post a public question.
More than (just) Themes
http://www.morethanthemes.com/