I have strings like "84", "03" etc. that I want to convert to Date objects, but Date.new only takes the expanded 4-digit year as a parameter. I know it’s simple to do, but I don’t want to reinvent this wheel. Is there something that does this already? Either in standard Ruby or in ActiveSupport.
I have strings like 84, 03 etc. that I want to convert to Date
Share
Pick a cutoff date.
Also, fix the cause of the two digit year, or else your system won’t be Y2K+cutoff compliant.