Fixing bug in date code for OSX