Article 3CX5M CodeSOD: Warp Me To Halifax

CodeSOD: Warp Me To Halifax

by
Remy Porter
from The Daily WTF on (#3CX5M)

Greenwich must think they're so smart, being on the prime meridian. Starting in the 1840s, the observatory was the international standard for time (and thus vital for navigation). And even when the world switched to UTC, GMT is only different from that by 0.9s. If you want to convert times between time zones, you do it by comparing against UTC, and you know what?

I'm sick of it. Boy, I wish somebody would take them down a notch. Why is a tiny little strip of London so darn important?

Evan's co-worker obviously agrees with the obvious problem of Greenwich's unearned superiority, and picks a different town to make the center of the world: Halifax.

function time_zone_time($datetime, $time_zone, $savings, $return_format="Y-m-d g:i a"){ date_default_timezone_set('America/Halifax'); $time = strtotime(date('Y-m-d g:i a', strtotime($datetime))); $halifax_gmt = -4; $altered_tdf_gmt = $time_zone; if ($savings && date('I', $time) == 1) { $altered_tdf_gmt++; } // end if if(date('I') == 1){ $halifax_gmt++; } $altered_tdf_gmt -= $halifax_gmt; $new_time = mktime(date("H", $time), date("i", $time), date("s", $time),date("m", $time) ,date("d", $time), date("Y", $time)) + ($altered_tdf_gmt*3600); $new_datetime = date($return_format, $new_time); return $new_datetime;}
release50.png[Advertisement] Release!is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped! TheDailyWtf?d=yIl2AUoC8zA8nDgo-RvG8o
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments