Skip to content

Instantly share code, notes, and snippets.

@richardbporter
richardbporter / drupal_tz_offset.php
Created August 1, 2012 15:53
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);
?>
function hostReachable() {
// Handle IE and more capable browsers
var xhr = new ( window.ActiveXObject || XMLHttpRequest )( "Microsoft.XMLHTTP" );
var status;
// Open new request as a HEAD to the root hostname with a random param to bust the cache
xhr.open( "HEAD", "//" + window.location.hostname + "/?rand=" + Math.floor((1 + Math.random()) * 0x10000), false );
// Issue request and handle response
<link rel="stylesheet" href="/sites/all/libraries/jquery.simplyscroll/jquery.simplyscroll.css" media="all" type="text/css">
<script type="text/javascript">
(function($) {
$(function() { //on DOM ready
$("#scroller").simplyScroll();
});
})(jQuery);
</script>
<ul id="scroller">