"StructuredTime" (Interpreter Type)
Time specification in a standard format.
Details
- "StructuredTime" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "StructuredTime" does not require connectivity to the Wolfram Cloud.
Allowed Forms
-
10:30 hh:mm 07:15:33 hh:mm:ss 22:45 24-hour clock 9:15 PM AM/PM - All the separators that DateList accepts are allowed.
Restriction Specifications
-
Restricted["StructuredTime",{{choices1,…}}] one among choices Restricted["StructuredTime",max] a time before max Restricted["StructuredTime",{min,max}] a time between min and max Restricted["StructuredTime",{min,max,unit}] a time between min and max, with resolution unit
Interpretation
- "StructuredTime" yields a TimeObject.
Examples
Basic Examples (3)
Interpreter["StructuredTime"]["10:11:43"]Interpreter["StructuredTime"]["3:30"]Restrict the time to be before noon:
Interpreter[Restricted["StructuredTime", TimeObject[{12, 0, 0.}]]]["21:20"]Use a different format that DateList allows:
Interpreter["StructuredTime"]["7:23 PM"]Interpreter["StructuredTime"]["10.19"]Restrict the value in a range and with a given resolution:
Interpreter[Restricted["StructuredTime", {TimeObject[{10, 0, 0.}], TimeObject[{12, 0, 0.}], "Hour"}]][{"11:00", "11:25"}]Interpreter["StructuredTime", DateFormat -> {"Hour", ".", "Minute"}]["9.46"]Related Guides
History
Introduced in 2014 (10.0)