dateTypeFor

Returns the XSD datatype matching an ISO-8601 lexical value: DATE_TIME when it carries a time component (T separator), DATE for a date-only value.

Use this when persisting user-supplied ISO-8601 strings so date-only values are not mistyped as xsd:dateTime (an ill-typed literal some servers reject).