Created
May 31, 2013 13:46
-
-
Save jcisio/5685082 to your computer and use it in GitHub Desktop.
Drupal: Format Date field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$node = node_load(48617); | |
$item = $node->field_simplenews_date[LANGUAGE_NONE][0]; | |
$date = new DateObject($item['value'], $item['timezone_db'], date_type_format($item['date_type'])); | |
// $date->format is not localized | |
$timestamp = $date->format(U); | |
print format_date($timestamp, 'custom', 'd F Y'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment