Skip to main content

<DateTime>

Category: Control tag

The DateTime tag adds date and time selection to the labeling interface. Use this tag to add a date, timestamp, month, or year to an annotation.

Use with the following data types: audio, image, HTML, paragraph, text, time series, video

Attributes​

AttributeTypeRequiredDefaultDescription
namestringyes—Name of the element
toNamestringyes—Name of the element that you want to label
onlystringyes—Comma-separated list of parts to display (date, time, month, year) date and month/year can't be used together. The date option takes precedence
formatstringyes—Input/output strftime format for datetime (internally it's always ISO); when both date and time are displayed, by default shows ISO with a "T" separator; when only date is displayed, by default shows ISO date; when only time is displayed, by default shows a 24 hour time with leading zero
minstringno—Set a minimum datetime value for only=date in ISO format, or minimum year for only=year
maxstringno—Set a maximum datetime value for only=date in ISO format, or maximum year for only=year
requiredtrue,falsenofalseWhether datetime is required or not
requiredMessagestringno—Message to show if validation fails
perRegiontrue,falseno—Use this option to label regions instead of the whole object
perItemtrue,falseno—Use this option to label items inside the object instead of the whole object

Examples​

Example 1​

<View>
<Text name="txt" value="$text" />
<DateTime name="datetime" toName="txt" only="date" />
</View>