single function to convert yyyymmdd to date