Slashdot Mirror


Adobe and Apple Didn't Unit Test For "Forward Date" Bugs. Do You?

llamafirst writes "As the year flipped to 2013, we learned that Adobe and Apple don't test for "forward date" bugs. Adobe prevented any copy of FrameMaker 10 from launching and Apple broke Do Not Disturb for the first week of 2013. Surely some more critical and safety systems also have lurking issues. Got tips for catching time/date bugs 'from the mysterious future?' (Also, obligatory link to Falsehoods programmers believe about time.)"

169 comments

  1. leap year by d3matt · · Score: 3, Interesting

    2012 cost us a decent chunk of change because for the third product line in a row, we screwed up seconds since epoch calculations... Every single customer was out of commission until we released a patch!

    --
    I am d3matt
    1. Re:leap year by LordLimecat · · Score: 1, Informative

      It seems like every 4 years on leap year, one of Microsoft's products breaks in a hillarious way. This year, it was Microsoft Azure (which was completely unavailable). 4 years ago, it was Zune and Exchange 2007 (Zunes simply did not function, Exchange had some management issues).

      Not sure if they had anything in 2004, like SBS2003 devouring all files edited that day or something, but Id be interested to know.

    2. Re:leap year by LinuxIsGarbage · · Score: 3, Informative

      Christ. Year after year, iOS alarm clock, DND, or something breaks on new years, leap year, DST, or something.

      IT JUST WORKS!!!!!

      https://discussions.apple.com/thread/3795574?start=0&tstart=0

      http://www.engadget.com/2011/03/14/ios-daylight-saving-time-woes-continue/

    3. Re:leap year by egranlund · · Score: 3, Interesting

      Yeah, I don't entirely understand why apple is having such a rough time getting basic time keeping and scheduling working...

    4. Re:leap year by tomp · · Score: 0

      The same reason everybody else has a rough time with it. It's hard. You wouldn't roll your own cryptography, don't roll your own date calculations.

    5. Re:leap year by Carewolf · · Score: 2

      Yeah, basic mobile phones deal with this problem much better than Apple, probably by doing nothing and just asking the GSM net what time it is. Why handle DST when the network can tell you what the local time adjusted for all recent legislation and leap seconds is?

    6. Re:leap year by Anonymous Coward · · Score: 0

      FWIW, I worked for two Fortune 100 companies, both of which had to shut down their primary systems during each DST change because their systems blew up horribly when the local time shifted by an hour. Their solution was to simply shut down the systems until the time had "stablized" (a minute in the spring, an hour in the fall).

      In an effort to actually test and fix the time-related bugs, I put together some small embedded Linux boxes running stand-alone NTP servers, which the developers and testers could point their systems to and make the time whatever they wanted it to be. Otherwise, it's hard to effectively test a bug that only appears once or twice a year.

    7. Re:leap year by theurge14 · · Score: 1

      Because iOS also runs on non GSM devices such as iPods and iPads and therefore cannot always depend on a network to handle time.

    8. Re:leap year by 21mhz · · Score: 0

      It's not totally simple. The biggest snafu with time on Windows Phone 7 has been unreliable setting of time zone based on network-provided time. Apparently it guesses the time zone locality out of the network-provided time zone offset and maybe the MCC of the network, and sometimes the guess turns out wrong. Many Finnish users were royally pissed when their phones were set to the Jordanian time zone and, as the result of the different DST regime there, went off DST weeks ahead of schedule.

      --
      My exception safety is -fno-exceptions.
    9. Re:leap year by Anonymous Coward · · Score: 0

      Christ. Year after year, iOS alarm clock, DND, or something breaks on new years, leap year, DST, or something.

      IT JUST WORKS!!!!!

      https://discussions.apple.com/thread/3795574?start=0&tstart=0

      http://www.engadget.com/2011/03/14/ios-daylight-saving-time-woes-continue/

      JUST SHUT YOUR NNTP MOUTH

    10. Re:leap year by Anonymous Coward · · Score: 0

      There is ways to test for "Forward Date" bugs using date simulation software. For IBM Mainframe there's Tic-Toc or Hourglass, in Linux, Windows and UNIX there's Solution-Soft's Time Machine. All of these allow one to fool an application into thinking the date is something other than the system time.

    11. Re:leap year by hab136 · · Score: 1

      >Why handle DST when the network can tell you what the local time adjusted for all recent legislation and leap seconds is

      Because some networks either don't send the time or are just plain wrong? I always have to switch to manual time setting when traveling through certain countries.

  2. Shouldn't Be A Problem... by lobiusmoop · · Score: 1, Funny

    The world will end on December 21, 2012 anyway.

    --
    "I bless every day that I continue to live, for every day is pure profit."
    1. Re:Shouldn't Be A Problem... by Sponge+Bath · · Score: 1

      It did, and we are all now posting from hell.

    2. Re:Shouldn't Be A Problem... by dkf · · Score: 1

      It did, and we are all now posting from hell.

      No change there then.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
  3. Neither did Google by Anonymous Coward · · Score: 3, Informative

    They left December out of Android Jelly Bean's date picker.

    1. Re:Neither did Google by Qzukk · · Score: 2

      Has anyone come up with a good way to test user interfaces yet other than to have someone sit slack-jawed and wiggle everything they see on the screen for hours on end?

      --
      If I have been able to see further than others, it is because I bought a pair of binoculars.
    2. Re:Neither did Google by alostpacket · · Score: 1

      I don't know about "good" but for Android there is Monkey Runner

      I don't think that would have saved December though.

      Maybe a unit test should assert that there are 12 items in the month list though.

      --
      PocketPermissions Android Permission Guide
    3. Re:Neither did Google by feedayeen · · Score: 1

      Has anyone come up with a good way to test user interfaces yet other than to have someone sit slack-jawed and wiggle everything they see on the screen for hours on end?

      The Java Robot class is built into the standard library and can be used to control mice, keyboards, and features screenshot capability. If you can come up with a way to convert menu selections in your application into a function call like selectMonth(2013,'March'), then you compose all of the related screenshots generated together. Now your slack-jawed guy just needs to play a game of spot the differences.

      I am sure better options exist.

    4. Re:Neither did Google by alostpacket · · Score: 1

      Robot is part of the awt package and thus is not supported on Android.

      http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/Robot.html

      The (better IMHO) Android class would be TouchUtils

      (Though it seems to be missing screenshot capability. )

      --
      PocketPermissions Android Permission Guide
    5. Re:Neither did Google by alostpacket · · Score: 1

      Sorry to reply to self but should add that the Android class for UI testing would be TouchUtils

      --
      PocketPermissions Android Permission Guide
    6. Re:Neither did Google by LordStormes · · Score: 1

      My shop used Rhino (JS running in the same JVM as your Java) to write JS automated test scripts. We've got about 800 of them now, and it's awesome. We've built it to run on multiple machines, aggregate logging, report failures, all built into our nightly build with Jenkins so we sit down in the morning and there's a list of issues waiting for us on all new code builds.

    7. Re:Neither did Google by Anonymous Coward · · Score: 0

      Apparently Google's infrastructure can collapse if the times are off by as much as a second... so they spread leap seconds out over a long period. This is way scarier than some date picker not working or appointment not showing up. You can use paper for your reminders or tie a string to your finger. But if Google bugs out it can take a lot of the internet with it.

    8. Re:Neither did Google by Anonymous Coward · · Score: 0

      have someone sit slack-jawed and wiggle everything they see

      It works for my pecker.

    9. Re:Neither did Google by GravityStar · · Score: 1

      One example for java (there are others): http://code.google.com/p/windowlicker/

  4. OP change the title by Anonymous Coward · · Score: 2, Insightful

    Why add "Unit Test?" just say "Test" unless you really mean a unit test.

    1. Re:OP change the title by Anonymous Coward · · Score: 0

      Why add "Unit Test?" just say "Test" unless you really mean a unit test.

      That's one of the funny things about jargon. Highly specific language is invented to let people communicate. Then people think it's elite or cool and start using it too without understanding the meaning. Eventually a phrase become so diluted it's completely useless for it's original intent, because no one can be sure what it really means. Hacking, zero-day exploit both come to mind.

  5. Trouble for them by gmuslera · · Score: 0

    The "Broken by design" paradigma is already patented by Microsoft. Hope they have some spare billons for the incoming lawsuit.

  6. Why? by gr8_phk · · Score: 4, Interesting

    Got tips for catching time/date bugs "from the mysterious future"?

    Why does software functionality depend on the date? Calculation issues maybe... but failure to lauch? WTF? I'm most curious to learn how this even happens.

    1. Re:Why? by Tanuki64 · · Score: 2

      Stupid copy restriction?

    2. Re:Why? by Anonymous Coward · · Score: 0

      Licensing checks? Checking for updates as part of starting up?

    3. Re:Why? by NatasRevol · · Score: 1

      You mean outside of software like ntp, Kerberos/AD, motion calculations, astronomical calculations, GPS.

      Just to name a few things off the top of my head.

      --
      There are two types of people in the world: Those who crave closure
    4. Re:Why? by Anonymous Coward · · Score: 0

      DRM

    5. Re:Why? by Anonymous Coward · · Score: 0

      Well, if that's the case the answer is "don't do licensing checks".

      If you do that based on the date, you'd better be prepared to test the software for each and every time and date.

      Simple, really.

    6. Re:Why? by Anonymous Coward · · Score: 0

      Got tips for catching time/date bugs "from the mysterious future"?

      Why does software functionality depend on the date? Calculation issues maybe... but failure to lauch? WTF? I'm most curious to learn how this even happens.

      Licensing restrictions would be my guess.

    7. Re:Why? by Zadaz · · Score: 2

      Why does software functionality depend on the date? Calculation issues maybe... but failure to lauch? WTF?

      Some kind of half-assed copy protection or trial use. "Dude, you totally changed the date to get around our 30 day trial! No more software for you!"

      Stupid, yes. But it exists.

    8. Re:Why? by Anonymous Coward · · Score: 0

      He asked why it would fail to launch not why the calculations might be wrong. Name a few more and actually think about it smart ass.

    9. Re:Why? by Hentes · · Score: 2

      These depend on time, not date.

    10. Re:Why? by Anonymous Coward · · Score: 0

      ...And typically time differentials, not absoute times.

    11. Re:Why? by sonamchauhan · · Score: 2

      See this link for an example: http://www.wmusers.com/forum/archive/index.php/t-5470.html

      webMethods' 'Trading Networks' B2B integration software (now owned by Software AG) used a GUID-generator routine which created 24-byte GUIDs for processing B2B documents. One of the inputs to this routine was the number of milliseconds between UTC and UNIX epoch.

      One day in 2004, the progress of time caused 25-byte GUIDs to be created. Trading Networks tried to insert these into a database column whose width was 24 bytes. So, at the same instant worldwide, none of their customers used this software could process B2B transactions!

    12. Re:Why? by holiggan · · Score: 1

      One word: DRM. I bet that some sort of validation was date-dependent and with the year rollover, it got wrecked :)

      Just my two euro-cents :)

      --
      "A sysadmin is a cross between a detective, a police officer, a gardener, a doctor and a fireman"
    13. Re:Why? by gr8_phk · · Score: 2

      That's so stupid. If your code is going to generate a 24 byte GUID then it should do so under any valid set of inputs to the GUID generator. In fact, if there it's even possible to generate a larger number it should be truncated to 24 just to be sure. If date and time are going into it, you have to consider a reasonable range of dates. But thanks for the example, it shows how little effort some companies put in.

    14. Re:Why? by sjames · · Score: 1

      In the case of Adobe, it is (as is often the case) the stupid license management that broke the program.

  7. Review by Anonymous Coward · · Score: 0

    Adobe's case? No, because I don't implement fucking DRM. Also, ha ha, pirates again score the better product versus honest customers.

    Apple's case? Absolutely, because behavior is supposed to change based on calendar events. We have some unit tests for that, right?

  8. I've had the opposite experience.... by Zapotek · · Score: 3, Interesting

    ...with forward dates braking my tests.
    I've had mock SSL certs and HTTP cookie jars that both expired and made it seem like the system was failing all over the place during unit/integration/general testing.

    So just watch out in general because this can swing either way...

    1. Re:I've had the opposite experience.... by Zapotek · · Score: 1

      Damn it! *breaking* /facepalm

    2. Re:I've had the opposite experience.... by Qzukk · · Score: 1

      Damn it! *breaking* /facepalm

      I bet your test system came to a screeching halt though, so it's still good!

      --
      If I have been able to see further than others, it is because I bought a pair of binoculars.
    3. Re:I've had the opposite experience.... by muddysteel · · Score: 2

      funny real event: Co-worker could not get his email client to work. Connection is managed using SSL, and the tunnel setup was failing. The reported error was a certificate invalid. That didn't jive with the CA cert - it was issued a year ago and is good for like 20 years.

      After looking and looking and looking: He realized his system date was set to 1/1/1980 - his CMOS battery was dead.. Jan 1 1980 is prior to the start of the validity period for the CA cert in use.. ;)

    4. Re:I've had the opposite experience.... by Bill,+Shooter+of+Bul · · Score: 1

      Yeah, that's happened to me. Shouldn't that just work, though. I mean unless you've invented time travel, why wouldn't you accept a cert that's before its validity period? Is there a vulnerability use case that I'm not aware of?

      --
      Well.. maybe. Or Maybe not. But Definitely not sort of.
    5. Re:I've had the opposite experience.... by Anonymous Coward · · Score: 0

      Yeah. It's used so that a 30 year certificate can't be created from a parent that guarantees annual renewal and reverification.

    6. Re:I've had the opposite experience.... by Zapotek · · Score: 1

      Because all it would take to break through the auth (or whatever the SSL certs were used for) would be to mess with the system clock -- could be hard, could be easy, doesn't matter, it'd be one more liability.

    7. Re:I've had the opposite experience.... by TheGavster · · Score: 1

      I can see it adding a little bit of security by obscurity by requiring an attacker who has acquired an expired cert to set the clock back just the right amount before using it, rather than just resetting to the middle ages. Of course, if you can set the clock on someone's machine you probably have little need to convince it to accept a bad cert ...

      --
      "Because Science" is one step from "Because old book". Try "Because of my experiment testing my falsifiable assertion".
    8. Re:I've had the opposite experience.... by Shimbo · · Score: 2

      Yeah, that's happened to me. Shouldn't that just work, though. I mean unless you've invented time travel, why wouldn't you accept a cert that's before its validity period? Is there a vulnerability use case that I'm not aware of?

      If your clock is resets to 1980, you don't know which certificates have expired. If you accept all, you run the risk of accepting a genuinely expired certificate. Although it would be more helpful to have the OS report implausible dates.

    9. Re:I've had the opposite experience.... by Anonymous Coward · · Score: 1

      > why wouldn't you accept a cert that's before its validity period?

      Because it is outside the validity period.

    10. Re:I've had the opposite experience.... by complete+loony · · Score: 1

      My wife's PC once booted up in the year 62,012. Since every single ssl cert was out of date, from her point of view the entire internet was broken.

      --
      09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
    11. Re:I've had the opposite experience.... by Anonymous Coward · · Score: 0

      What computer system and OS support holding or displaying five digit years?

    12. Re:I've had the opposite experience.... by complete+loony · · Score: 1

      Wait, not 62,012. It was 6,212. On windows 7.

      --
      09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
  9. Bug not a feature. by Anonymous Coward · · Score: 0

    Normally, the obligatory "It's a bug not a feature" comment would be sarcasm.
     
    As with most things apple, though ... there will be plenty of people who think it's genuine.

  10. Edge Cases by Anonymous Coward · · Score: 0

    We test our edge and special cases pretty thoroughly, "beginning" and "end" of time, every DST spring/fall, and leap years/seconds.

    Still have bugs though.

  11. Simple... by Synerg1y · · Score: 1

    Don't hard code dates, calculate them. If you have reference tables for date pair values, there needs to be a process in place to update those tables. Can't think of a whole lot more that can go wrong on a year change....

    Oh, dynamically calculated dates need to factor in the 12/31 to 01/01 change, formulas / functions that work the other 364 days tend to fail here in their first year in production a lot. That only applies to the actual year switch though, and when the app/report is specifically run on 01/01.

    Anything else?

    1. Re:Simple... by Anonymous Coward · · Score: 0

      On that point, don't store future datetimes in GMT. Store it in the Timezone local to the event and the TZ offset. We saw from the last time the government changed timezones that it became a huge massive clusterfuck because it was impossible to know if any given date had already been corrected for the change in GMT (and believe me, from the perspective of the human who is using your software, THEIR time did not change: their 10AM appointment should still be at 10AM).

    2. Re:Simple... by Nerdfest · · Score: 1, Insightful

      I think all dates and times should be stored in UTC (not GMT). Storing them in anything that is affected by time zones and DST is just asking for trouble. DST and Time Zone are presentation problems ... not storage problems.

    3. Re:Simple... by Anonymous Coward · · Score: 0

      Did you actually read the post you replied to?

    4. Re:Simple... by DavidRawling · · Score: 1

      OK, so how will you solve the GP's problem then? Or to put it another way, here are two future meeting dates. Which one has been updated to reflect the new timezone, and which one has not:

      • Jan 27, 2013 03:00:00 UTC
      • Jul 15, 2013 16:00:00 UTC

      I'm not saying that the GP's solution is perfect, but you've completely ignored the problem in making your comment. Unfortunately we live in a time where politicians and lobby groups think time is pretty flexible (sorry about the pun). So you probably need to store in UTC with an associated original timezone, original timezone offset, and a last updated time. For some apps that could be overkill. For others, it might be necessary.

      You need the timezone information so that you record the creator's intent - I set this to 10 am Thursday in my timezone because I want it to be at 10am. You need the last updated date/time so that you know what the timezone configuration was when it was updated (i.e. "it was created/changed in daylight saving time, so even though we're now NOT in DST, I need to do some extra correcting of the display").

      TL:DR; time is harder than it seems.

    5. Re:Simple... by Nerdfest · · Score: 1

      I'm not sure you understand what I mean. A UTC time is not affected by timezone or daylight savings time. If you store local dates in the current timezone, it's affected by both. At least twice a year you're screwed for an hour and don't really know what time it is. UTC times can be displayed in any timezone/DST combination you like ... they're absolute times. I work on international systems that deal with these problems all the time. Saving times in UTC is the only way that actually solves all of the problems, including people creating data in one time zone and it being used in another.

    6. Re:Simple... by Hes+Nikke · · Score: 1

      To elaborate, I would recommend storing dates as seconds (or milliseconds if you need that resolution) since a well defined epoch in UTC (Unix uses 00:00:00 UTC on 1 January 1970, before macs switched to unix, they used January 1, 1904 and January 1, 1601 for Windows). You can go from there and convert to whatever timezone you like.

      --
      Don't call me back. Give me a call back. Bye. So yeah. But bye our, well, but alright we are on a shirt this chill.
    7. Re:Simple... by Anonymous Coward · · Score: 0

      Meeting times are usually something people want in local time. By converting a future meeting time from local to UTC, you are making an assumption about the timezone, at that location in the future. When that future date arrives, to convert back from UTC to local, you will probably use the actual timezone in place at that time, which may not align with the timezone you assumed would be in place when the meeting time was originally set. Hence, the meeting would have changed in local time.

      E.g. someone wants to schedule something for lunch at noon local time for some future date. Currently you expect the time zone on that date to be UTC+3, so this gets recorded as 9 in UTC. The timezone gets changed to UTC+4, whether because the daylight savings time start/end date changed, daylight savings was abandoned/accepted, or you are in some country with a new government that is changing it for the heck of it. Now it looks like the meeting should be at one in the afternoon. Without saving what timezone was used to create it, you can't tell if it was made from the locale with the changed timezone and needs to be updated, or if it was made in reference to some other timezone that did not change, so should stay the same (maybe it was aligned to a telephone meeting in another country).

    8. Re:Simple... by GravityStar · · Score: 1

      Hmmm. Given a appointment on October 1st, 2014, 22:00. Appointment is in a country that has no summertime/wintertime difference. GMT/UTC offset is say +1:00.

      On February 1st, 2013 the government decides that from September 2013, there will be a summertime/wintertime difference. Wintertime offset will be +2:00.

      When stored in UTC, the appointment is now rendered with a local time of October 1st, 2014, 23:00. IMHO, the timezone, and the timezone offset are not just presentation issues; they are an implicit part of the data the user entered. Although I concede my example is a bit contrived.

    9. Re:Simple... by Nerdfest · · Score: 1

      That is correct. You also need to store *when* it was created if you want to handle DST changes in some cases, depending on how you want to use the dates.

    10. Re:Simple... by Anonymous Coward · · Score: 0

      he seems to have as the post he replied to provided a very poor solution to the problem as it implies the time specified is always based on the local time, this is a really bad thing to assume especially in todays age of virtual meetings and con calls, where a con call meeting on one side of the country really doesn't give 2 shits what timezone changes you had. UTC is the only safe mechanism, if there is a need to fix the time to a local with a variable timezones then you write additional functionality to handle that.

    11. Re:Simple... by Carewolf · · Score: 1

      I think all dates and times should be stored in UTC (not GMT). Storing them in anything that is affected by time zones and DST is just asking for trouble. DST and Time Zone are presentation problems ... not storage problems.

      Unless they are user alarms, opening hours etc. A lot of things need to _not_ be adjusted for DST, if you stored them in a absolute format, you would suddenly need to adjust them.

    12. Re:Simple... by tlhIngan · · Score: 1

      To elaborate, I would recommend storing dates as seconds (or milliseconds if you need that resolution) since a well defined epoch in UTC (Unix uses 00:00:00 UTC on 1 January 1970, before macs switched to unix, they used January 1, 1904 and January 1, 1601 for Windows). You can go from there and convert to whatever timezone you like.

      So let's say I schedule a meeting with you at 10 AM on August 1. If we take brain-dead-simple NA DST rules, your UTC appointment now occurs at 9AM. Ah, but I said 10, so you'd be wasting an hour of your time because your alarm went off an hour earlier.

      OK, the opposite situation happens as well - it's July and you want to schedule a meeting in December. Now you'll look silly and be an hour late.

      Want even more fun? Try scheduling meetings around the world between April and November- unlike North America with well defined DST rules, many countries have rules that are at the whim of the government as to when they start and stop. Others don't. Others may have well defined times but differ from North American transitions (which is great fun for a weekly meeting when it moves an hour for a few weeks until it syncs up again).

      Somehow, I think even Microsoft got it wrong. It's just that Outlook is so widely used that if it's wrong, no one notices because Outlook just reminds them of a meeting And some group of developers at Microsoft is busy trying to replicate it bug-for-bug so calendar alarms line up.

      The original entry must be preserved and re-parsed across transitions because the user's intent may simply be "I want this meeting to happen 10AM my time every Friday". "My time" means "regardless of timezones, or DST" - the meeting is at 10AM dammit and will not move to 11AM or 9AM (depending on when it was made and if DST was in effect).

    13. Re:Simple... by Hes+Nikke · · Score: 1

      of course when converting from natural date to offset from epoch, you use a database that keeps track of the details as to what offset from UTC is used when. That said, date math is a fucking PITA even when you have all the tools at hand.

      --
      Don't call me back. Give me a call back. Bye. So yeah. But bye our, well, but alright we are on a shirt this chill.
  12. 2038 by Dishwasha · · Score: 3, Informative

    I for one am stockpiling canned meat in my bomb shelter for 2038. By the time 2038 comes, software will be so virtualized and there will be so many layers between operational computer software and what's under the hood that it will take at least a decade to fix this problem in our future society.

    1. Re:2038 by Anonymous Coward · · Score: 0

      Could it be spam, spam, spam, spam, spam, and spam?

    2. Re:2038 by rubycodez · · Score: 1

      the mainstream virtualization wares used at enterprise level already use 64 bit time

      some control and embedded system are more like to be troublesome, but the failures will be sporadic. stay out of your bomb shelter and laugh at the companies who lose

    3. Re:2038 by sco08y · · Score: 1

      the mainstream virtualization wares used at enterprise level already use 64 bit time

      some control and embedded system are more like to be troublesome, but the failures will be sporadic. stay out of your bomb shelter and laugh at the companies who lose

      You cunning son of a bitch... You're just saying that to lure me out of my bomb shelter!

    4. Re:2038 by Anonymous Coward · · Score: 0

      I for one am stockpiling canned meat in my bomb shelter for 2038. By the time 2038 comes, software will be so virtualized and there will be so many layers between operational computer software and what's under the hood that it will take at least a decade to fix this problem in our future society.

      I am wary of any canned meat stockpiled today that does not expire by 2038....

    5. Re:2038 by sonamchauhan · · Score: 2

      Have your forward-date tested the edibility of your canned spam?

      If you plan to eat it in 2038, you really, really should, :)

  13. Time. . . by smittyoneeach · · Score: 1

    . . .is a Western disease.

    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    1. Re:Time. . . by rubycodez · · Score: 1

      never been to Tokyo or Kuala Lumpur or Tapei? some asian societies take the concept of workaholic to the next level....

    2. Re:Time. . . by smittyoneeach · · Score: 1

      I was stationed out of Yokosuka for a year, where I heard the aphorism.
      Truly a different mindset.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    3. Re:Time. . . by green1 · · Score: 1

      Knowing what time it is implies you are looking for quitting time. If you work 24/7 you don't need to know what time it is!
      Now get back to work!

  14. Unit Test? by Threni · · Score: 1

    What does this have to do with Unit Tests?

    1. Re:Unit Test? by Nerdfest · · Score: 1

      Other than that fact that good unit tests would have caught this problem, not much.

  15. Nope by T.E.D. · · Score: 1

    Seeing as I got an automated message castigating me for not filling out my electronic timesheet for 12/30 (a vacation day), and I heard tales of some folks getting a double paycheck and being asked to pay the extra back, I'm guessing the answer is no.

    1. Re:Nope by sconeu · · Score: 1

      Not to mention that 30 Dec 2012 was a Sunday....

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
  16. It's very simple... by Anonymous Coward · · Score: 1

    Points in time are *always* represented internally as seconds-since-epoch (or milliseconds, or whatever unit makes sense for your app). Calculations are always done on values which are seconds-since-epoch. The *only* time that a date is *ever* converted to a year/month/day hour:min:sec representation is strictly for display purposes.

    Do this, and 99% of time-related bugs never occur. The problems with date-related logic almost always stem from some programmer thinking that they should carry a date around internally in a broken-out, human form - and that is always a mistake.

    1. Re:It's very simple... by Anonymous Coward · · Score: 0

      The *only* time that a date is *ever* converted to a year/month/day hour:min:sec representation is strictly for display purposes.

      The real world uses dates in human form. The real world demands business logic that can identify the first day of the month or the last friday of the year, and if you say, "use a lookup table", someone is going to demand business logic that can automatically populate that table.

      The *real* problem with date-related logic is programmers like you thinking there is a simple one-size-fits-all solution that they can implement themselves instead of doing it the proper way: using library functions. No matter how smart you think you are, you will get screwed trying to roll your own date handling.

    2. Re:It's very simple... by jc42 · · Score: 1

      No matter how smart you think you are, you will get screwed trying to roll your own date handling.

      So you're telling me that I should trust the date-handling library routines provided by hugely successful corporations like Adobe and Apple, right? ;-)

      And yes, I have seem my code's time handling badly screwed up because I trusted the delivered library routines. So I learned to test them thoroughly, and in a few cases, I've had to replace them with routines that were correct. Granted, I usually got these from online open-source repositories, but in a few cases I've had to augment these with some code of my own - and send them my code. They've generally thanked me for the contribution, and sometimes said that they got some good laughs from my descriptions of the problems in our local library routines.

      True naivetï½ is trusting code supplied by an organization whose primary motive is profit, not engineering quality.

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    3. Re:It's very simple... by jc42 · · Score: 0

      True naivetý is ...

      Jeez; ya can't even get away with using a mot franÃais that's commonly used in English here. And we're talking about quality products ...

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    4. Re:It's very simple... by Anonymous Coward · · Score: 0

      While true in a sense, I don't think it is that insightful, except to a few novice programmers that would try to carry dates around internally in some human readable format. That whole process of converting from human formats to seconds since epoch is a major difficulty and source of potential bugs. Most of the assumptions made about times and dates would cause problems when trying to input or output such information, and those can't be just swept under the rug. You can try to trust some library to handle most of it, but still need to consider a lot of aspects of date and time formating and potential issues when designing an UI if you need things to be really robust.

      And that is just if dealing with your own, isolated piece of software. Not every communication format is fortunate enough to use seconds since an epoch. And even when it does, sometimes it really sucks when trying to deal with manufacturers of timing equipment that mix up UTC and TAI...

    5. Re:It's very simple... by GravityStar · · Score: 2

      Bull, I find bugs all the time *because* dd/mm/yyyy in applications is often stored/operated on with millisecond/second precision.
      Let's see:
      a) the case of the missing midnight: some date or another in the 1920's IIRC that doesn't have a 00:00:00 hour but that day starts at 02:00:00 hour (so, two missing hours). Unable to create or store that date with the time set at midnight.
      b) range 01/01/2012 - 10/12/2012 entered by the user, inclusive. On 10/12/2012 00:00:01 the system determines the current date is no longer in the range. Bug, certainly not what the user intended.
      c) amount of days between 1/1/2012 CET and 1/6/2012 CEST. A naive way to calculate this is is to subtract the two dates (with millisec precision) and divide by 24 hours. That will give the wrong answer though.

      Anyway, I've come to believe that in an application you store/use the date the user typed in, not a derivative with millisecond precision.

      And, also agree with DragonWriter above.

    6. Re:It's very simple... by Anonymous Coward · · Score: 0

      True naïveté would be in believing decimal time would catch on after the revolution?

    7. Re:It's very simple... by marcosdumay · · Score: 1

      b) range 01/01/2012 - 10/12/2012 entered by the user, inclusive. On 10/12/2012 00:00:01 the system determines the current date is no longer in the range. Bug, certainly not what the user intended.

      How do you make an inclusive range of ANY value that you'll store on a medium with higter resolution than your range? Ans. You add 1 to the end point, and store as a not inclusive range. (You will also want to subtract 1 of the high resolution units if you are storing it in a countable representation.) Nothing different for dates.

      c) amount of days between 1/1/2012 CET and 1/6/2012 CEST. A naive way to calculate this is is to subtract the two dates (with millisec precision) and divide by 24 hours. That will give the wrong answer though.

      That's still not a reason for not representing your time in seconds since epoch. Any representation that solves this problem will make it hard to order timestamps and calculate the lenght of intervals. Instead of changing your notation, you just don't do it the naive way.

    8. Re:It's very simple... by Anonymous Coward · · Score: 0

      It is spelled naïveté though...

  17. Seriously by ozduo · · Score: 0

    we need an accurate method of identifying and solving these future bugs because they are playing havoc with my Tardis!

    --
    I got to the chocolate box before you, that's why the hard ones have teeth marks.
  18. No by Anonymous Coward · · Score: 0

    Our software only needs time periods less than approx .2 seconds. And we have everything in Zulu and represented as tai64n. Converting to/from human readable time is not our problem

  19. yes we do by Anonymous Coward · · Score: 0

    and daylight savings time is the worst idea ever!

    1. Re:yes we do by jc42 · · Score: 1

      and daylight savings time is the worst idea ever!

      and any number of economist types have even told us that it totally fails at its advertised advantages. ;-)

      But I wouldn't call it the worst idea ever. It's social and economic problems aren't in a league with such ideas as slavery, war, and religion. ;-)

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    2. Re:yes we do by Yobgod+Ababua · · Score: 1

      As long as your system uses milliseconds since the epoch internally, daylight savings (and leap years, and leap seconds) are all simple problems of translation for human-readable display and will not effect functionality.

      It's the difference between what we "call" a particular point in time and how much time has physically elapsed.

      That said, I'm completely not sure how to properly deal with computers in highly accelerated reference frames who will have experienced a different quantity of elapsed time than their stationary compatriots...

  20. Forward testing by fyngyrz · · Score: 4, Funny

    Well, there was no point in forward testing after Dec 21, 2012, you see.

    --
    I've fallen off your lawn, and I can't get up.
  21. Very simple...but misses many common needs by DragonWriter · · Score: 3, Insightful

    Points in time are *always* represented internally as seconds-since-epoch (or milliseconds, or whatever unit makes sense for your app). Calculations are always done on values which are seconds-since-epoch. The *only* time that a date is *ever* converted to a year/month/day hour:min:sec representation is strictly for display purposes.

    Frequently, calculations require both points in times and intervals of time; the former can consistently be represented as seconds since epoch, the latter doesn't really have a usable equivalent (you could use just seconds, but then things don't work as expected, since often its actually important to the user that the interval be an exact number of days, weeks, months or years, which may not be reducible to a consistent number of seconds, but instead that will depend on how the point in time the offset is being calculated against is represented in Year/month/day/hour/minute/second form, because leap seconds, leap years, and different lengths of months all make interval calculations tricky.)

    You can't restrict conversion of seconds-since-epoch to calendar format to display-purposes-only if you are going to do anything useful with dates.

  22. Certificate expiration by Anonymous Coward · · Score: 0

    My biggest fear is an expiring certificate ending civilization.

    Outside of testing around DST boundaries I don't test for the future specifically. Past is prologue.

  23. Watching my Linux Mint laptop closely. by Andy+Prough · · Score: 1

    I'm sure it will break at any moment, since it's not supported by a big, expensive company like Apple or Adobe. Think I will see smoke first?

  24. only relevant for license code by Anonymous Coward · · Score: 0

    Since I'm working on code that does not really care what day it is, this is a REALLY silly problem to worry about.
    That is, if it is important to you, it means you are writing code which is GUARANTEED to fail to work sometime, based upon WHEN.

  25. BTDT..... by Anonymous Coward · · Score: 0

    One of the features I had the (mis)fortune to develop dealt with future offsets, DST, and different timezones. I knew to test it. How does anyone not think to test DST and year-end rollover for a TIME app!?

  26. Resume fodder by user-hostile · · Score: 1

    Great. Now I can list "follows best practices of software giants such as Adobe and Apple" on my resume!

  27. Residual Y2K Problem by Anonymous Coward · · Score: 0

    Commercial software is rife with forward date bugs. To deal with the Y2K problem many companies modified code to assume that any two digit year less than or equal to 50 was 1900s and any two digit year greater than 50 was 2000s. How many of those companies took the time and spent the money to go back and update their software to four digit years?

    1. Re:Residual Y2K Problem by LordStormes · · Score: 1

      How many people will be using a 50+ year old OS/app in 2050 when it would become a problem?

    2. Re:Residual Y2K Problem by Andrewkov · · Score: 1

      Funny, that's exactly what we said in the 60's, 70's and 80's when we used 2 digit year codes to save space.

    3. Re:Residual Y2K Problem by xenobyte · · Score: 1

      Ah yes... Back when 1999 turned into 2000 we did have a small Y2K problem... We used a support system written in perl where the naive programmer assumed that the year provided by the 6th field of the localtime decoder was the two last digits of the year. So to get the actual real year he prefixed the year with '19' as a string. This works fine until the year 2000 is reached. As the 6th field of localtime is the number of years since 1900, not just the last two digits, the year becomes 19100, not 2000. This makes all dates prior to 2000 (19100) very, very old and any and all posts will thus get purged in the general cleanup... Thankfully we had a working backup...

      The code was full of homemade conversions between dates, complete with other whopping errors.

      Smarter systems use only seconds internally and only convert to dates for display purposes or to find "stuff from this month" or similar.

      --
      "For every complex problem, there is a solution that is simple, neat, and wrong." -- H.L. Mencken (1880-1956) --
  28. The bigger question, with a possibly scary answer: by Anonymous Coward · · Score: 0

    Why would a forward year matter in the first place? What kind of sloppy code is being written that can't cope with a simple change in the year?

    I shudder to think...

  29. one of these days by hurfy · · Score: 1

    I am itchin to fire up the old minicomputer and see what it thinks of 2013..of course i have been saying that since Y2K. Too bad it would mean turning off all the electrical stuff in my house to get enough juice to spin up the HD :O

    1983 Wang computer..the login screen had calenders loaded until 2030 was always curious if it really would have been ok but noone wanted to risk it and it was retired in 1998. Can't believe it's been 14 years and i haven't even seen if it still works, altho that 1960 watts draw on the HD alone and the 5 lb transformer on the CPU box are a little intimidating. Time sucks

    1. Re:one of these days by rubycodez · · Score: 1

      should be fine,internal dates are stored as YYYYMMDD including in PACE database. People still run Wang software virtualized on intel hardware from TransVirtual Systems http://www.transvirtualsystems.com/

  30. Automated testing by LordStormes · · Score: 2

    My shop has over 800 automated test scripts, all of which have been running on machines that think it's 2013-2014 for over a year, and will be bumped up to 2014-2015 by the end of the month.

    1. Re:Automated testing by Anonymous Coward · · Score: 0

      Wow. What's your solution for testing the test scripts? (CAPTCHA: multiply)

    2. Re:Automated testing by Anonymous Coward · · Score: 0

      You're full of shit.

    3. Re:Automated testing by Anonymous Coward · · Score: 2, Insightful

      Why is he full of shit? Any professional business that produces software has automated scripts doing such testing. We do full regression tests on a weekly basis and nightly break tests including future dates. We run thousands of scripts. If you think that is full of shit you need to stay the fuck away from software development.

    4. Re:Automated testing by LordStormes · · Score: 1

      This.

  31. Dates are not hard! by jackb_guppy · · Score: 1

    This other /. artical says it best How Can I Explain To a Coworker That He Writes Bad Code?

    It's now almost 35 years ago, when I had to write date routines that spanned the year 2000 and only use 2 char year, and only use the same 5 nibbles of storage that the julain date was stored in, in the end that system could handle a ~250 year period it took about about 500 Bytes of size. Then I wrote a rouitne that in 13 nibbles handle that same time period got us down to 8ms ticks. We then used them every where in the system. It is not hard, just need to be tested.

    Why are these bad coders still in the system, that can't do the simple math let alone simple testing.

    1. Re:Dates are not hard! by Anonymous Coward · · Score: 0

      Why are these bad coders still in the system, that can't do the simple math let alone simple testing.

      Dates are hard because humans meddle with them. If you think otherwise, you are either inexperienced or a poor programmer. What date was the last Friday of 2011? In Samoa, it was Dec 23rd.

      If you are rolling your own datetime math, you need to be taken out back and shot. Use a library.

    2. Re:Dates are not hard! by Anonymous Coward · · Score: 0

      But the people that wrote the libraries have already been taken out back and shot.

  32. Don't test - inspect by Anonymous Coward · · Score: 0

    Don't test. Inspect.

    If you can't inspect, how do you plan to exit test?

    http://www.mfagan.com/pdfs/ibmfagan.pdf

  33. 32-bit UNIX HAS A PROBLEM IN 2038++ by Anonymous Coward · · Score: 0

    There's a "date problem" for you, lol... -> http://en.wikipedia.org/wiki/Year_2038_problem

    * :)

    APK

    P.S.=> Let the 'flames' commence - Yes, there are "fixes" but do ALL 32-bit UNIX's employ them? I doubt it...

    ... apk

    1. Re:32-bit UNIX HAS A PROBLEM IN 2038++ by rubycodez · · Score: 1

      don't forget mysql (regardless of platform) will also fail. I'd be even more worried about embedded systems than any silly pc or server.

  34. Intricacies of time by plopez · · Score: 1

    Specifically temporal consistency. A guy by the name of Snodgrass wrote a book on it and I urge everyone to al least skim through it. See his website: http://www.cs.arizona.edu/~rts/

    --
    putting the 'B' in LGBTQ+
  35. s/unes/Zunes/ by sconeu · · Score: 0

    Forgot to preview

    --
    General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
  36. Yes by jtavares2 · · Score: 1

    I test for all possible future dates.

  37. or the new calendar with a leep week by Joe_Dragon · · Score: 1
  38. Falsehood 35: by John+Hasler · · Score: 1

    No one would be stupid enough to set the system clock to local time.

    --
    Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
  39. Bad Assumptions About Dates and Times by swilly · · Score: 1

    Here is one that really bit me in the ass once. Daylight Savings Time happens on different days depending on which country you are in, and the operating system doesn't always know when this should be.

    Back in 2007 I was deployed to Iraq supporting military systems. In Iraq, Daylight Savings happened on April 1st and October 1st, but Windows didn't know that. Using the Baghdad time zone Windows thought that daylight savings happened on the same days that it did in the US. So, for about a week, every computer on the domain had the wrong time. The administrators of the domain controller didn't think this was a big deal, and things will fix themselves soon, so why bother adjusting our clock? Normally that would be fine, since the military has standardized on Zulu (GMT) since forever, and all military systems were required to store and transmit dates in that format. But there was one system, which I won't name, that used local time for its database and then asked Windows to convert to Zulu time for the XML data transfer. It took several days before we found out that every date and time we were given from them was a lie. This caused us all sorts of problems and fixing all of the dates was a major pain.

    After all the complaints, the meetings with developers, and so on, we naturally thought that the developers for this system had gotten their act together and fixed their problem so we wouldn't see it again. Nope. Sure enough, in October we had the exact same problem, except this time I was watching for it and modified our insert into SQL Server to adjust the time. (I'm not a fan of putting a lot of business logic in stored procedures, but it really helped that time.) I made sure that my replacement was aware of the situation before the next change in April, but apparently they finally fixed their database by then.

    What I learned is that databases should always use GMT and you should never ask the system for the local time and then convert to GMT, as it may lie. Instead ask the system for the GMT time.

    1. Re:Bad Assumptions About Dates and Times by Anonymous Coward · · Score: 0

      Iraq didn't use daylight savings from 2008 onwards.
      I guess that is one way to fix it.

    2. Re:Bad Assumptions About Dates and Times by Culture20 · · Score: 1

      No daylight savings in Iraq? Hmm. Nah, still not worth moving.

    3. Re:Bad Assumptions About Dates and Times by marcosdumay · · Score: 1

      What I learned is that databases should always use GMT and you should never ask the system for the local time and then convert to GMT, as it may lie. Instead ask the system for the GMT time.

      All sane* databses store time as seconds since epoch. That's a format that can be converted to GMT without error whatever are the settings of your OS. The user interface, by the other side, rarely uses a simple format, and will often translate things wrong.

      * Yes, if your database doesn't do that, it's insane. so are its developers and you for developing/using it. I get the no true scotsman, no need to point it.

  40. Framemaker still exists? by Ralph+Spoilsport · · Score: 1

    dayum. I haven't heard the word "framemaker" in like an aeon or two. I thought it bit the dust when Quark and InDesign took over.

    --
    Shoes for Industry. Shoes for the Dead.
    1. Re:Framemaker still exists? by SkimTony · · Score: 1

      I suspect you're thinking of PageMaker, which was replaced by InDesign. FrameMaker is a whole different popsicle stand; as I understand it, it's the difference between laying out a page, and laying out a whole book.

  41. personal favourite by Anonymous Coward · · Score: 0

    My personal favorite is that a time only happens once.
    Alas it isn't true when the time goes back an hour for dst and you are foolish enough to store the time in local timezone.

    1. Re:personal favourite by Geeky · · Score: 1

      I actually knew of an old mainframe system that had to be switched off for an hour when the clocks went back so that it didn't get confused and try to log the same time twice.

      --
      Sigs are so 1990s. No way would I be seen dead with one.
    2. Re:personal favourite by Anonymous Coward · · Score: 0

      I worked in a manufacturing business and this is exactly what we did. I loved working that day because at 2:00am we shut down the mainframe and I waited *TWO* hours (just to be sure) and then booted it back up. At least once a year I was able to take a 2 hour nap at work!

  42. Correct on embedded, see link... apk by Anonymous Coward · · Score: 0

    It's part of WHY I posted it (brake systems especially) -> http://en.wikipedia.org/wiki/Year_2038_problem

    * VERY GOOD of you to note what you did though...

    (Thanks much, on the tip on mySQL - as I had NO IDEA on that much!)

    APK

    P.S.=> Lastly - Do you have a link to that issue on mySQL? I'd appreciate it, & "TIA" (thanks-in-advance)...

    ... apk

    1. Re:Correct on embedded, see link... apk by rubycodez · · Score: 3, Informative

      I could supply link, or better yet let's make the proof this thread. See how timestamp beyond 2038-01-19 03:14:07 gets foobared.

      rubycodez@hyperion:~$ mysql -u root -p
      Enter password:
      Welcome to the MySQL monitor. Commands end with ; or \g.
      Your MySQL connection id is 40
      Server version: 5.5.28-0ubuntu0.12.04.3 (Ubuntu)

      Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

      Oracle is a registered trademark of Oracle Corporation and/or its
      affiliates. Other names may be trademarks of their respective
      owners.

      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

      mysql> create database timedb;
      Query OK, 1 row affected (0.00 sec)

      mysql> use timedb;
      Database changed
      mysql> create table tvalue(t timestamp);
      Query OK, 0 rows affected (0.00 sec)

      mysql> insert into tvalue values ('2012-12-21');
      Query OK, 1 row affected (0.00 sec)

      mysql> insert into tvalue values ('2038-01-30');
      Query OK, 1 row affected, 1 warning (0.00 sec)

      mysql> select * from tvalue;

      | 2012-12-21 00:00:00 |
      | 0000-00-00 00:00:00 |

      2 rows in set (0.00 sec)

      mysql>

    2. Re:Correct on embedded, see link... apk by Askmum · · Score: 1

      And now try the same using the datetime datatype.
      Incidently, the timestamp is (in the mysql manual) described with a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC. So it's not a bug, it's a feature.

    3. Re:Correct on embedded, see link... apk by rubycodez · · Score: 1

      it's a poor design, it will cause problems for applications such as mortgage or actuarial tables

  43. Careful setting dates by leighklotz · · Score: 1

    In late 1999, we tested a product by rolling the date forward to 2000-01-01 and it worked fine. Then we rolled the date back to the normal date, and files that got touched during the test period caused trouble, because their modification date was "IN THE FUTURE!?!?!?" as one piece of code put it. The most broken was the timestamp data for a time-based UID generator, which flat out refused to run, saying that it was in danger of generating collisions.

  44. "1 warning" - got ya... apk by Anonymous Coward · · Score: 0

    As good as required I suppose - good catch, & I *wish* I knew that back in a database class I took years ago that was implemented using mySQL in fact...

    Would've knocked the prof. for a loop...

    * Thank-You... your select query result does the rest!

    (Would that also hold true on the 64-bit version of mySQL as well, since it IS 64-bit? Just curious...)

    APK

    P.S.=> I am assuming that is truthful here, & though I have the 64-bit version of mySQL downloaded here to test? I just have NO inclination (or energy tonite to be honest) to load it & test...

    ... apk

  45. LOL - it's IN MY LINK! by Anonymous Coward · · Score: 0

    Per my subject-line above - PERTINENT QUOTE/EXCERPT:

    "MySQL database's inbuilt functions like UNIX_TIMESTAMP() will return 0 after 03:14:07 UTC on 19 January 2038.[6] The limit reached will vary in time, based on the time zones as in the following table:" FROM -> http://en.wikipedia.org/wiki/Year_2038_problem

    (Yup - I am TIRED tonite boy... lol!)

    APK

    P.S.=> Still, ) really am interested if this would be a problem on 64-bit versions of mySQL too... shouldn't be, but they don't really specify in the link above either, so... hence, my question to you in my other reply! You may already know the answer since you are using it regularly it appears, & are maintaining 40 connections to it I see as well...

    ... apk

    1. Re:LOL - it's IN MY LINK! by rubycodez · · Score: 1

      yes, that is 64 bit, the issue is in how mysql stores the data not OS

  46. Good programming by Murdoch5 · · Score: 1

    If that is causing your software to crash or to start have issues then STOP PROGRAMMING! Proper programming prevents those kind of issues. I'm not saying that you shouldn't test for this kind of issue but if you program properly in the first place a date overflow wont crash your software. You tend to see this kind of error with Object Oriented programmers, a good C programmer will have handled this before it happened.

    1. Re:Good programming by jgrahn · · Score: 1

      If that is causing your software to crash or to start have issues then STOP PROGRAMMING! Proper programming prevents those kind of issues. I'm not saying that you shouldn't test for this kind of issue but if you program properly in the first place a date overflow wont crash your software. You tend to see this kind of error with Object Oriented programmers, a good C programmer will have handled this before it happened.

      A good programmer would have handled it, period. As others have mentioned, there are very few excuses to handle time as anything but an offset from epoch. It's no different in the object-oriented languages I know.

    2. Re:Good programming by Murdoch5 · · Score: 1

      I pointed of Object Oriented languages because a lot of them have date handling that I've seen people rely on. You should never rely on a built in check to save your butt. You need to do the check yourself and handle it.

  47. Your tests weren't buggy ... by sonamchauhan · · Score: 1

    I've seen a vendor issue a super-urgent patch. IIRC, it contained an update to an expiring CA certificate. They could have forseen this issue with time-shift testing of the type you did (which 'breaks' your test, but it also proves the need to install update CA certs by a future date)

    My other post has an example why time-shift testing is important.
    http://apple.slashdot.org/comments.pl?sid=3356429&cid=42472583
    (It was the same vendor in both cases)

  48. Sharepoint weirdness by skeffstone · · Score: 1

    We have a Microsoft Sharepoint system at work where we log our project hours. Hitting Save now moves all hours to one later date, until everything is deleted at January 7th...

  49. ObBetteridge by Anonymous Coward · · Score: 0

    No.

  50. DOS date - Find me! by scsirob · · Score: 1

    I built a set of DOS-based diagnostics tools for SCSI tape streamers about 20 years ago. The logging function checks for time validity and asks the user to try and find me if it is really beyond 2038. And yes, I tried testing that, except DOS didn't let me set the date beyond its valid end..

    --
    To Terminate, or not to Terminate, that's the question - SCSIROB
  51. Abode not test their stuff? by gelfling · · Score: 1

    Surely you jest. Well at any rate I'm sure they'll fix it with an 857MB patch to Adobe reader.

  52. Re:Using GSM For Time by Anonymous Coward · · Score: 1

    iOS has another problem because it does use GSM to get time. If you live on the edge of a time zone, the time is affected depending on which cell tower is in use and what time zone it is in. A friend of mine uses an iPad in a city on the state border. His calendar app works fine at one end of the building. When he goes to the other end of his building, a cell tower in a different time zone is in use and the time is off by an hour when he creates a new appointment.

  53. Maybe a DSL could help here by Yogs · · Score: 1

    Most date bugs I've seen (and coded earlier in my career) related to "close enough" approximations of the right logic, that turned out not to be close enough for one reason or another. Some of this related to insufficient information... one clock assumes what the other is doing but can't get info from that clock.

    But a larger fraction was just that doing things with stupid hacks way was vastly quicker because with a different APIs every time, and always verbose and clumsy, it's not tempting to do a deep dive every time and really learn what the hell is going on in there.

    We've seen with another ~practically~ fundamental datatype, strings, that dsls make this much less of a PITA. So why 40 years later do we not have something similar for timestamps and intervals at least for the damn gregorian calendar? (would take a lot more thought to generalize over others, maybe worth the effort, maybe not). I ask this seriously because I'm kind of tempted to tilt at this windmill, do a spec and first implementation for Java, at minimum, maybe also JavaScript and an sql dialect or two.

  54. Apple's bug explained - Or why it autofixes itself by tlhIngan · · Score: 1

    The Apple one is really odd - because if you read Apple's response, it makes no sense. It automatically fixes itself on January 7? WTF? Date/time bugs don't usually have self-expiry dates (though Apple's response is adequate since the bug will auto-fix itself before Apple could fix and test the update). And especially since there's nothing seemingly *special* about January 7...

    Ars has a nice write up about it - http://arstechnica.com/apple/2013/01/ask-ars-why-will-apples-do-not-disturb-bug-fix-itself-next-week/

    TL;DR version: The DND bug is because well, to the DNS part of IOS the year is 2012. In fact, it's technically week 53 because of the way Apple chose to code DND.

    It's a mismatch between the calendar date and the ISO Week date (at least, the consensus seems to be this since the effect is reproducable and a bit of silliness in NextStep APIs make it a REALLY easy bug).

    There's even code that repros the bug.

  55. Not surprising by Anonymous Coward · · Score: 0

    This is to be expected of these two companies in particular, they notoriously use outdated tech on their modern applications, change features without warning and are generally only interested in making money, not providing a quality product. Not saying they've always been this short-sited but the bigger they get the worse they get. You think with increased access to resources you wouldn't have to lie and brainwash the public into thinking that they have great products.

    Out of the box it's got that wow quality everyone wants, and then you use it. Most Apple users these days are so guilt-ridden into not complaining that I fear a whole generation has been negatively affected in how to provide quality feedback which means much extra time dealing with crappier and crappier products. The worse part, other companies try to emulate this.

    Adobe and Apple both may have brands that will last for years but for the most part - these companies that I used to love have lost it a long time ago. Adobe being the worse out of the two if you can believe that. They are just hateful at this point against their own supporters.

  56. Not just pc software by whitroth · · Score: 1

    It happens. For example, in the late eighties, when I was still on a mainframe, halfway through my stint at at Fortune 500 company (referred to, ever since, as the Scummy Mortgage Co, SMC, actual name available upon request, and for many, many, many reasons), they fired (not laid off) the other online programmer, who'd been there 10 years. A few months later, I found his "algorithm" for leap year in most of the online systems: if it was 76 or 80 or 84 or 88 or 92, it was a leap year.

    I kid you not.

    I went to my boss, the VP of DP, and told him about it, and he said, is it broke? I told him it would be broken in a couple of years, and he told me, "if it ain't broke, don't fix it". But, but, I said, and he replied, "we'll fix it whern it breaks".

    And this was in a *mortgage* co - y'know, people who have to calculate 30 mortgages?

                          mark, shaking head

  57. Unit Testing? Really? by Anonymous Coward · · Score: 0

    1) Who cares if the devs didn't unit test. That just means they missed a step. The QA team should have caught it with manual testing/automated testing/magic.

    2) To the people who can't figure out how dates can bite you. Consider the following scenario - you have to localize some software with a date in it. Thai is one of the locales. They use the Buddhist calendar which means that this year is not 2013 but it's actually 2556. That's a pretty easy thing to overlook.

  58. It's time for... by ewertz · · Score: 1

    ... metric time -- bring on kilodays, nanodays, all of it. I can't wait another microday for this.

  59. Another false assumption by Anonymous Coward · · Score: 0

    The list of false assumptions about time does not include one that I found in a past version of Microsoft SOAP Toolkit:

    If the current year's "spring forward" is in the future, then daylight savings time is not currently in effect.

    If you think that's true, check the 2013 "spring forward" date in any place where daylight savings time is currently in effect.

  60. Excellent, & thanks... apk by Anonymous Coward · · Score: 0

    You merit the +4 upward moderated rating you received... good job!

    APK

    P.S.=> Sorry for the delayed reply, & "onwards & upwards"...

    ... apk

  61. Beware of Jan 1, 2022!!! by Yobgod+Ababua · · Score: 1

    I found an "amusing" bug in a software deployment system recently that will break horribly on Jan 1, 2022. (Much sooner than the usually announced doom-dates of 2038 and such).
    It's a fairly simple cock-up, so I wouldn't be surprised to find it elsewhere.

    Step 1: Make decisions based on a datestamp.
    Step 2: Define that datestamp as "YYMMddHHmm".
    Step 3: Somewhere along the line, shove that string into a 32bit signed integer.

    The maximum value we can store is thus "2147483647", so the "2201010000" of Jan 1, 2022 will overflow to a negative value. Hooray!

    Completely stupid. Completely avoidable. Using the standard "milliseconds since the epoch" we're still only at "181825596", and would have made it all the way into 2038 before running into a similar failure. My only solace is that we'll have abandoned this particular software by then. YOU may not be so lucky...