https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/advanced includes 2 queries with invalid datetime literals eg "2000-00-00T00:00:00Z"^^xsd:dateTime (mm=dd=00).
https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2020/02 includes a query with date literals eg "2000-00-00"^^xsd:dateTime that are doubly invalid (mm=dd=00 and missing time part).
GraphDB and other repos reject such queries with eg Query evaluation error: Invalid value 0 for Month field.
WDQS should do the same, to discourage bad practices and for query compatibility with other repos.
A few more tests:
select * { bind("2000-00-00T00:00:00Z"^^xsd:dateTime as ?x) bind(day("2000-00-00T00:00:00Z"^^xsd:dateTime) as ?x1) # returns 1 ??? bind("20-00-00T00:00:00Z"^^xsd:dateTime as ?y) # accepted, but year must have at least 4 digits bind(year("20-00-00T00:00:00Z"^^xsd:dateTime) as ?y1) # returns 20 bind(?x-?y as ?z) # 723180.0: divided by 365.24 gives 1980 years and a bit bind(datatype(?x-?y) as ?z1) # xsd:double #bind("20-00-00T00:00:00Z"^^xsd:dateTime - "20"^^xsd:gYear as ?t) # fails with Unknown error: 20-00-00T00:00:00Z }