Time
The Time registry provides tools to manage and manipulate dates, times, and time-related calculations, making it easy to handle time-based data in your projects.
date
{{ "2023-05-04T15:04:05Z" | toDate "2006-01-02T15:04:05Z" | date "Jan 2, 2006" }} // Output: "May 4, 2023"dateInZone
{{- $date := "2023-05-04T15:04:05Z" | toDate "2006-01-02T15:04:05Z" -}}
{{ dateInZone "Jan 2, 2006" $date "UTC" }} // Output: "May 4, 2023"
{{- $date := "2023-05-04T15:04:05Z" | toDate "2006-01-02T15:04:05Z" -}}
{{ dateInZone "Jan 2, 2006" $date "invalid" }} // Errorduration
dateAgo
now
unixEpoch
dateModify
durationRound
htmlDate
htmlDateInZone
Last updated