added method to parse dates to comparable format