DateTime Handler Reference

Specification of the internal representation

This section shows exactly which features and values are allowed in the interal representation of the DateTime Handler. It is of crucial importance to keep this format in order to not break the interpretation step.

Feature Possible Values Examples
year {1950 - 2050}, {MODIFIER} 2018 → ['year': 2018], next year → ['year': 'next']
quarter {1 - 4}, {MODIFIER} 2nd quarter → ['quarter': 2], last quarter → ['quarter': 'previous']
month {1 - 12}, {MODIFIER} april → ['month': 4], this month → ['month': 'this']
month_modifier {MODIFIER} next april → ['month_modifier': 'next', 'month': 4]
week {1 - 53}, {MODIFIER} week 23 → ['week': 23], last week → ['week': 'previous']
day_of_month {1 - 31}, {MODIFIER} 23. april → ['day_of_month': 23, 'month': 4], the next day → ['day_of_month': 'next']
weekday {WEEKDAY} wednesday → ['weekday': 'wed']
weekday_modifier {MODIFIER} next wednesday → ['weekday_modifier': 'next', 'weekday': 'wed']
named_relative {NAMED_RELATIVE} Tomorrow → ['named_relative': 'tomorrow']
named {NAMED} Christmas Day → ['named': 'christmas_day']
hour {1 - 12} 4 o'clock → ['hour': 4, 'meridiem':'ampm']
minute {0 - 59} 13:15 → ['hour': 1, 'meridiem':'pm', 'minute':15]
second {0 - 59} 13:15:45 → ['hour':1, 'meridiem':'pm', minute:15, second:45]
meridiem {AMPM} 3 pm → ['hour':3, 'meridiem':'pm']
time_of_day {TIME_OF_DAY} morning → ['time_of_day': 'morning']
time_of_day_modifier {MODIFIER} this evening → ['__time_of_day_modifier__': 'this', 'time_of_day':'evening']
relation {RELATION} in 5 days → ['relation':'in', 'offset': ['day': 5]]


Nested Expression Possible Values Examples
duration [DATEUNIT]:{1 - 99} 3 weeks and 4 days → ['duration': ['week':3, 'day':4]]
offset [DATEUNIT]:{1 - 99} 5 months ago → ['relation': 'ago', 'offset: ['month':5]]
date_anchor [DATE] 3 days before Christmas Eve → ['relation': 'before', 'offset':['day': 3], 'date_anchor': ['named': 'christmas_eve']]
time_anchor [TIME] 20 past 3pm → ['relation': 'after', 'offset':['minute':20], 'time_anchor':['hour':3, 'meridiem':'pm']]


Value set Values
{MODIFIER} previous_previous, previous, this, next, next_next
{WEEKDAY} mon, tue, wed, thu, fri, sat, sun, satsun
{NAMED} christmas_eve, christmas_day, new_years_eve, new_years_day, midsummer_eve
{NAMED_RELATIVE} today, yesterday, tomorrow, day before yesterday, day after tomorrow
{RELATIVE} day_before_yesterday, yesterday, tomorrow, day_after_tomorrow
{RELATION} after, ago, around, before, between, during, in
[DATEUNIT] year, month, fortnight, week, day

Was this page helpful?