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.)"

109 of 169 comments (clear)

  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 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?

    5. 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.

    6. 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 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.

  5. 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 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
    3. 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.

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

      These depend on time, not date.

    5. 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!

    6. 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"
    7. 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.

    8. 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.

  6. 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 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.

    6. 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".
    7. 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.

    8. 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.

    9. 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.
    10. 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.
  7. 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 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.

    2. 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.

    3. 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.

    4. 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.
    5. 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.

    6. 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.

    7. 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.

    8. 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).

    9. 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.
  8. 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 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

    2. 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!

    3. 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, :)

  9. 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!

  10. 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.

  11. 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.
  12. 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 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.
    2. 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.

    3. 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.

  13. 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.
  14. 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.

  15. 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?

  16. 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!

  17. 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/

  18. 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: 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.

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

      This.

  19. 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?

  20. 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.

  21. 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+
  22. Yes by jtavares2 · · Score: 1

    I test for all possible future dates.

  23. or the new calendar with a leep week by Joe_Dragon · · Score: 1
  24. 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.
  25. 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.

  26. 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 Culture20 · · Score: 1

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

    2. 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.

  27. 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.

  28. 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.

  29. 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.
  30. 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>

  31. 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.

  32. 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.

  33. 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)

  34. 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...

  35. 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
  36. 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) --
  37. 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.

  38. 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.

  39. 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.

  40. 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.

  41. 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.
  42. 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.

  43. 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

  44. 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.

  45. 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. 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

  47. 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...

  48. 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...