{{ time }}

{{ time }}

Represents a specific instant in a specific timezone.

Properties

Field Type Description
object_type string Will always be "time".
is_valid true/false Will always be true.
is_future true/false Will be true if the instant is in the future and false if the instant is in the past.
year integer The calendar year.
month integer The calendar month (1-12)
day integer The calendar day of the month (1-31)
day_of_year integer The day of the year (1-366).
day_of_week number The day of the week (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, or Sunday)
hour integer The hour of the day (0-23)
minute integer The minute of the hour (0-59)
second integer The second of the minute (0-59)
offset time_diff The utc offset of the timezone at this instant expressed as a time_diff (ranging from -14 to +14 hours)
timezone string The full timezone identifier
timezone_short string The shortened timezone identifier, if applicable, for the given timezone at this instant (may vary depending on time of year, and for some timezones may be the same as the full timezone identifier).

Examples

Calendar Entry time and formatting

Copy
{% if calendar_entry.start_date.date.is_future %} Event will start on {{calendar_entry.start_date | date: 'g' }} {% elsif calendar_entry.end_date.date.is_future %} Event is currently in progress {% else %} Event completed on {{calendar_entry.end_date | date: 'g' }} {% endif %}

Time advanced

Copy
{% var meridian = 'am' %} {% var hours = article.post_date.date.hour %} {% if hours > 12 %} {% set hours = hours | minus: 12 %} {% set meridian = 'pm' %} {% endif %} The year was {{ article.post_date.date.year }}. It had been {{article.post_date.date.day_of_year}} days, or {{ article.post_date.date.month }} months and {{ article.post_date.date.day }} days past the new year. The day was a {{ article.post_date.date.day_of_week }} and the time was {{ hours }}:{{ article.post_date.date.minute }}{{ meridian }}, but that didn't matter.