Erik Meyer
Erik Meyer

Reputation: 33

not facet-valid with respect to pattern type 'DateTimeType

Im receiving the error below. Any help appreciated.

cvc-pattern-valid: Value '2015-01-16T07:30:22.576+00:00' is not facet-valid with respect to pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d+)Z?' for type 'DateTimeType'.

Below is an example of the data that im converting to the date and time.

20150118150020150118

Upvotes: 3

Views: 1688

Answers (2)

DougJ
DougJ

Reputation: 1

Just put data into regex checker (regex.com), looks like (.\d+) doesn't like +00:00

Upvotes: 0

Cfx
Cfx

Reputation: 2312

Decomposing ´2015-01-16T07:30:22.576+00:00´ to the pattern gives

\d{4} 2015
-
\d{2} 01
-
\d{2} 16
T
\d{2} 07
:
\d{2} 30
:
\d{2} 22
(.\d+) 576
Z?

But there is still ´+00:00´ in your input. That does not match the pattern because ´Z´ stands for zone symbol. Try with a lowercase ´z´ that stands for ´ZONE_NUMERIC´ (-1200 - +1200)

Upvotes: 1

Related Questions