Updated method dateFromString