Shouldn't this function be stricter about what it accepts?  Isn't ISO8601 enough?