Skip to content

Instantly share code, notes, and snippets.

@richardbporter
Created August 1, 2012 15:53
Show Gist options
  • Save richardbporter/3228079 to your computer and use it in GitHub Desktop.
Save richardbporter/3228079 to your computer and use it in GitHub Desktop.
Drupal format_date timezone offset
<?php
$my_date = strtotime($node->field_date[0]['value']);
$tz_offset = strtotime(date("M d Y H:i:s")) - strtotime(gmdate("M d Y H:i:s"));
$my_date += $tz_offset;
print format_date($my_date, 'custom', 'D d F Y', NULL);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment