Date and Time values in Internet Object are represented using annotated strings that follow ISO 8601-compatible formats. These provide built-in support for temporal data with automatic parsing to native Date objects during deserialization. Internet Object supports three distinct temporal types: dates, times, and combined date-time values.
Date and time values are scalar values that represent temporal data. The content between the quotes must be valid according to their respective format specifications.
d'2024-03-20' # Full date with separators
d'2024-03' # Year and month (day defaults to 01)
d'2024' # Year only (month and day default to 01)
d'20240320' # Full date without separators
d'202403' # Year and month without separators
d"2024-12-31" # Double quotes supported
t'14:30:45.123' # Full time with milliseconds
t'14:30:45' # Hour, minute, second
t'14:30' # Hour and minute (second defaults to 00)
t'14' # Hour only (minute and second default to 00)
t'143045123' # Without separators
t'143045' # Without separators, no milliseconds
t'1430' # Without separators, hour and minute
t"09:00:00" # Double quotes supported
dt'2024-03-20T14:30:45.123Z' # Full datetime with timezone
dt'2024-03-20T14:30:45.123' # Full datetime, no timezone
dt'2024-03-20T14:30:45' # Without milliseconds
dt'2024-03-20T14:30' # Without seconds
dt'2024-03-20T14' # Without minutes
dt'2024-03-20' # Date only (time defaults to 00:00:00.000)
dt'20240320T143045123Z' # Without separators
dt'2024-03-20T14:30:45+05:30' # With timezone offset
dt'2024-03-20T14:30:45-08:00' # Negative timezone offset
dt"2024-12-31T23:59:59.999Z" # Double quotes supported
d2024-03-20 # ✗ Missing quotes
d'2024-13-20' # ✗ Invalid month (13)
d'2024-02-30' # ✗ Invalid date for February
t'25:00:00' # ✗ Invalid hour (25)
t'12:60:00' # ✗ Invalid minute (60)
dt'2024-03-20 14:30:00' # ✗ Missing T separator
dt'2024-03-20T14:30:00+25:00' # ✗ Invalid timezone offset
d'2024-03-20T14:30:00' # ✗ Date prefix with time component
t'2024-03-20T14:30:00' # ✗ Time prefix with date component
dt'2024-03-20T14:30:00.123456' # ✗ More than 3 millisecond digits
dt'2024-03-20T14:30:45Z' # → UTC time: 2024-03-20T14:30:45.000Z
dt'2024-03-20T14:30:45+05:30' # → UTC equivalent: 2024-03-20T09:00:45.000Z
dt'2024-03-20T14:30:45-08:00' # → UTC equivalent: 2024-03-20T22:30:45.000Z
dt'2024-03-20T14:30:45' # → UTC time: 2024-03-20T14:30:45.000Z (default)
d'2024-03-20' # → Date: 2024-03-20 (time irrelevant)
t'14:30:45' # → Time: 14:30:45.000 (date irrelevant)
# UTC time: 2024-03-20T14:30:45.000Z
→ dt'2024-03-20T14:30:45.000Z' # DateTime format
→ d'2024-03-20' # Date format
→ t'14:30:45' # Time format
# Time with offset: 2024-03-20T14:30:45.000+05:30
→ dt'2024-03-20T14:30:45.000+05:30' # DateTime format with offset
→ d'2024-03-20' # Date format (timezone ignored)
→ t'14:30:45' # Time format (timezone ignored)