• Robert Morson (google)

    Mandatory asinine initial comment.

  • bvs23bkv33 (unregistered)

    please switch to Kiev

  • someone (unregistered)

    Obligatory implication that such code is a result of being written in PHP.

  • Ben Curthoys (unregistered)

    I live a few miles north of Greenwich, pretty much dead on the prime meridian. I found a bug in some GPS software once, because my longitude was something like 0.00000001 and some default string formatting routine rendered that as 1E-8, and then a different parsing routine later failed to parse it back in properly.

  • Oliver Jones (google)

    Danger! Don't go down this route of timezone WTFs. There is enough timezone WTFery in the world to generate material for the daily WTF until the Sun becomes a white dwarf star. The trouble is, it's banal. It's at the heart of the banality of WTF (sorry Hannah Arendt).

    That being said, Halifax as the location of the principal meridian? Why not?

  • Brian (unregistered) in reply to Oliver Jones

    Don't we know it... not just time zones but time in general is a major source of contributions around here.

    That said, if you're running on a distributed system and your backend server is in a particular location, why not sync everything to that location's time zone? Makes data analysis a bit easier.

  • (nodebb)

    Interestingly, PHP's increment operator works on floats! It is very C-like in this regard.

  • P (unregistered)

    Why should Halifax in America be the centre of the world? Obviously it should be Halifax in the UK!

  • Decius (unregistered)

    The only true time is number of microseconds since Unix was written, which is timezone independent.

  • Jonathan (unregistered) in reply to Brian

    As someone who lives in a country with a single timezone with no daylight savings, I also used to think like you many years ago, but ask yourself a couple of questions in regards to your proposed approach.

    What if that server's location's timezone has daylight savings, when you record the times in the database, are you persisting daylight savings or non-daylight savings time? If that records an event added at 2:30am on the a day that it is moving out of daylight savings, what time is that relative to other time zones?

    For that second question, it's actually impossible to be sure, 2:30am is ambiguous as it happens twice on that day, which is why every decent software language these days has an API for trivially handling conversions of times and dates to and from UTC taking into account things like daylight savings, with the idea being that you always persist your data as UTC, then convert it coming out as needed.

    While one might argue that at the end of the day UTC is an arbitrarily chosen reference point for all other times, and you could in theory choose some other timezone time (which doesn't suffer daylight savings), the fact is that UTC is the reference point which pretty much all software knows how to work against.

    Even JavaScript plays nicely with UTC with no libraries installed, type the following in your browsers console (F12 in Chrome) new Date("2000-01-01 00:00:00Z") and press enter. Unless your computer has it's timezone configured to GMT, you will notice it has changed the time to your local time.

  • RLB (unregistered)

    I was going to remark "wrong Halifax", but I see P's already been to Ilkla Moor baht 'at.

    So I'll just note that Cornify is back, but I haven't seen any rainbows yet, only rainbow-coloured unicorns (and grey and golden ones).

  • Milan (unregistered)

    The real WTF is that you usually have no way to suppress recalculation to UTC - I can see why such code get requested in first place. In my experience I have more often need to store and calculate time without any timezone than with it. In distributed environments it can be hard to get current "clock on the wall" time at location.

  • Smash (unregistered) in reply to Oliver Jones

    Because, whenever you create a new particular standard (as in, it is particular because you don't dominate the industry and can't make everyone else use it), you end up having to support the standards you had before AND the new one.

    You'll eventually have to take input from from sources that do not follow your standard (it could even be people from inside your company that are used to the older standard), and then you get the wonderful experience of finding out a bit too late that you saved a lot of data in your DB that do not conform to your standards and it's now impossible to separate the tainted and "pure" data. Or you'll have to be on your guard for all eternity double checking every input if it is conforming to your standard.

    When two differing standards clash, you might end up with a Mars Orbiter disaster.

  • Smash (unregistered)

    Damn I was supposedly replying to Brian's question

  • gggg (unregistered) in reply to Jonathan

    In my country time moves forward at 1:00am to 2:00am and backwards from 2:00am to 1:00am. So 01:30 am will occur twice when moving back.

  • Scott (unregistered) in reply to Brian

    Also, leaving time in UTC allows you to move servers between time zones (or have multiple, redundant servers in different locales) without having to guess what the time represents.

  • Matt (unregistered) in reply to Decius

    Unfortunately Unix time ain't that. It's both defined in terms of a specific time zone (UTC) and takes into account leap seconds. As such Unix time is not an actual count of elapsed seconds since the epoch.

  • ZZartin (unregistered)

    That seems like way way to much work to do something that should be as simple as adding/subtracting a few hours to a datetime.

  • thegoryone (unregistered) in reply to someone

    Don't blame PHP for this developer being brain dead, they released improved DateTime functionality in 2006 with PHP 5.2.

    it's the "//end if" that really makes the code, though

  • (nodebb) in reply to RLB

    He's also overlooked a small point: there isn't just one Halifax in "America". If we (incorrectly) take "America" in time zone strings to mean "the USA", the there are seven, but the best-known Halifax in (North) America is Halifax, Nova Scotia, which is in Canada.

    These eight different Halifaxes aren't all in the same time zone.

  • Randal L. Schwartz (google) in reply to Steve_The_Cynic

    Well, America/Halifax is a very specific time zone though: https://timezonedb.com/time-zones/America/Halifax

  • (nodebb) in reply to Randal L. Schwartz

    Sure, which is why I was careful about what I wrote. It's still ambiguous. ("America/Canada/Halifax" would be less problematic, except for questions of ... politics, because for at least some other instances of three levels, "America/X/Y", the middle part ("X") is a US state.)(1)

    (1) Which inspires memories of my 11th grade Social Studies teacher (in Endicott, NY), who poked fun at ethnocentrism by advocating, based on a series of economic, political, and defence-oriented benefits, unifying all of North America into a single country...

    ... and that it should be called Canada. The surprised outrage from the other students was clearly audible. Being not from either of the countries in question, I laughed quietly to myself.

  • Russ (unregistered) in reply to Steve_The_Cynic

    You're just trolling. In PHP, America/Halifax is unambiguous. It refers to a specific timezone. To call it ambiguous is like calling the color green ambiguous because color-blind people won't know the difference.

  • Eric (unregistered)

    If you don't know the reference of the title of this post, Google "Happy in Paraguay" and watch the video.

  • John (unregistered)

    Fine by me. I'm sitting next to Halifax Harbour right now.

  • Dave (unregistered)

    Halifax in Nova Scotia. It'd be a true WTF if it was Halifax, West Yorkshire.

  • eric bloedow (unregistered)

    for some reason an old "Tintin" comic strip comes to mind: apparently French ships used to use Paris as zero on their maps, which complicated a treasure hunt Tintin and his friends were on... also, there was a Darwin Award story where a group of terrorists were killed by their own bomb, apparently because of confusion over Daylight Savings time. oh yeah, and an old adventure game used "halifax" as a password to open a treasure chamber!

  • Herr Otto Flick (unregistered) in reply to eric bloedow

    Everyone used to use their own meridian, the French/Belgians would have used the Paris Meridian, and maps weren't updated as frequently back then ;)

  • siciac (unregistered) in reply to Decius


    The International Space Station begs to differ.

  • FormalWare (unregistered)

    And why are Halifax residents called "Haligonians"? And precisely when is the Last Tango in Halifax (vs. Greenwich)?

  • jmm (unregistered)

    From Hell, Hull, or Halifax....

  • Sherrif of Huddersfield (unregistered) in reply to Oliver Jones

    But everybody knows the centre of the universe is Huddersfield ;-)

  • linepro (unregistered)


    I recall that someone in the operations department told me that we used to run one windows server in Asia/Baghdad time (physically in America/Chicago) so that the data consumed in the data centre in Europe/London (UTC) would be happy. Simply because the software running was modifiable and the resultant localtime changes between the data received (EDT) and what was required (UTC) cancelled out.

  • A-Nony-Mouse... (unregistered)

    Weel, There is "Meantime Brewing Company" in Greenwich which has some rather nice beers.. I have no knowledge of such a place [does not be it is not there] in any of the Halifax's I am aware of ;)

  • (nodebb)

    Timezones are just plain weird. Nicely though one of games I play has a new "daily challenge" that pops up every day at midnight "local time". For us in the USA that puts us at a strategic disadvantage as we are the last to have the end of the day, and the beginning. All is not lost since Apia (in Samoa) is nicely on the other side of the date line and only a couple of hours ahead. A simple set of the time zone allows one to jump ahead a day.

    Oh, it hasn't helped me get a higher ranking score. Oh, well.

  • bobcat (unregistered)

    Ten bucks and a fig newton says this was the result of a clueless manager demanding that the time be set 'properly' rather than using weird 'foreign time'.

  • medievalist (unregistered)

    Greenwich has the distinction of being where John Flamsteed punched out Isaac Newton.

  • Carl Witthoft (google)


    The International Space Station begs to differ.

    Ok -- does it differ about being TZ_independent, or just about the number of elapsed microseconds up there as opposed to down here? Or both?

  • Robert (unregistered) in reply to Carl Witthoft

    Remember, Unix time sweeps leap seconds under the carpet. As a consequence of that, the ones digit (in base ten) of Unix time is always the same as the ones digit of the seconds in UTC. Except maybe during a leap second. I'm not sure Unix time is even defined during a leap second.

  • i_like_speed (unregistered) in reply to thegoryone

    Ever see this at the end of a code block: } } } } } ... and wish you knew which } is which?

    :) Just sayin'

  • (nodebb) in reply to Robert


    Leap seconds are treated like an error. The local clock is simply instantaneously found to be a second out with a high-quality time source, and NTP will resynchronize that sort of thing easily.

  • RLB (unregistered) in reply to eric bloedow

    @eric bloedow: They did, and you can still see where it ran. A couple of decades ago they mounted a number of medallions in the pavement all down France to mark its anniversary or something like that. I've stood on both meridians.

  • RLB (unregistered) in reply to Steve_The_Cynic

    @Steve_the_Cynic: still all eight the wrong Halifax, though.

  • Moy (unregistered) in reply to P

    or better yet...Halifax in Canada...

  • siciac (unregistered) in reply to Carl Witthoft

    Ok -- does it differ about ...

    It differs because it has its own time; per relativity, there is no "true" flow of time.

  • Álvaro González (github) in reply to gleemonk

    Interestingly, PHP's increment operator works on floats!

    Not sure what floats are involved in this snippet but PHP increment operator works on everything (as long as you're flexible with the definition of "to work"). It's the Chuck Norris of operators.

    foreach ([7, 7.1, 'a', 'ZZ', new DateTime('2017-01-12 00:00:00 UTC'), fopen(FILE, 'r')] as $value) { $x = $value; var_dump($value, ++$value); }

    int(7) int(8) float(7.1) float(8.1) string(1) "a" string(1) "b" string(2) "ZZ" string(3) "AAA" object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-12 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(DateTime)#1 (3) { ["date"]=> string(26) "2017-01-12 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } resource(5) of type (stream) resource(5) of type (stream)

  • airdrummer (unregistered)

    apparently apple's weather app is based in pdt, as it displays yesterday's weather for 3 hours;-\

  • airdrummer (unregistered)

    apparently apple's weather app is based in pst, as it displays yesterday's weather from 12-3am est

  • (nodebb)

    Actually, amazingly, this makes sense. No doubt it's completely obsolete now but there was an arcane truth about Halifax, Missouri. Because it was near the center of the continental United States, it used to be where AT&T's Master Clock for their entire phone system was located. Can't find that on the web now, something I read about years ago.

    Addendum 2018-01-13 09:17: I wonder where our Master Clock is now?

    Addendum 2018-01-13 09:31: Found it. And it's a false memory. Hillsboro, Missouri.


  • funkenstein (unregistered)

    Dayjob Orchestra is the real WTF! https://www.youtube.com/watch?v=414TmP12WAU

Leave a comment on “Warp Me To Halifax”

Log In or post as a guest

Replying to comment #492170:

« Return to Article