Y1.9K Compliance



  • I'm guessing the programmer of the site I inherited was busy watching Barney the Dinosaur and Friends while the rest of us were worrying about Y2K.  Check this out:

     Function processDate(currdate)
        currMonth = Mid(currdate,3,2)
        currDay = Right(currdate,2)
        currYear = "20" & Left(currDate,2)


  • That will make the Y2.1K problem, not the Y1.9K.



  • I don't think 21xx dates are used a lot, but they still have a lot of dates with 19xx (birth dates), so yeah this would be a Y1.9K problem ;)



  • @XIU said:

    I don't think 21xx dates are used a lot, but they still have a lot of dates with 19xx (birth dates), so yeah this would be a Y1.9K problem ;)


    Yeah, but look, date is called currDate here, so it should not be used to process past (or future) dates.
    So it is the Y2.1K problem.



  • Its taking input that is obviously YYMMDD. While the function is probably unnecessary I'd have to know more about the receiving data and where it comes from to consider it that much a WTF to just prepend 20. Any other logic would arbitrarily cut off at another date anyway since the incoming data is known to have only a two digit year. That data, I might guess, is likely coming from a source external to the application of that function.



  • @tray said:

    Yeah, but look, date is called currDate here, so it should not be used to process past (or future) dates.
    So it is the Y2.1K problem.
    Well, since functions - especially non-specific-sounding ones like that are only ever called in the intended manner, I guess we're ok!

     

    "What's this? 'processdate'? Wait, I have a date to process! I'll pass it in and it should all be wonderful!"



  • He wanted to make sure his kids have work during the Y21H craze


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.