This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

DatePattern

DatePattern
represents the characters of a date with elements of type in StringExpression.
DatePattern
allows separators that match the string expression sep.
  • Possible element types are: , , , , , , , , , .
  • If no explicit separator is specified, the must be separated by , , , or characters.
Compare a string to a list of date elements:
Compare to a list of time elements:
Compare to a pattern with all separators explicitly given:
Compare a string to a list of date elements:
In[1]:=
Click for copyable input
Out[1]=
 
Compare to a list of time elements:
In[1]:=
Click for copyable input
Out[1]=
 
Compare to a pattern with all separators explicitly given:
In[1]:=
Click for copyable input
Out[1]=
Date elements do not match out-of-range values:
Test a string allowing only "/" characters as separators:
Test the same string allowing only colon separators:
Define a function only for month, year strings:
The function returns unevaluated for other input patterns:
DateString gives results that match a date pattern:
New in 6