...
To use the date-time value in the display pattern, you must convert it by passing the liquid filter local_date. Local date uses the timezone of the regional settings of my client laptop or alike.
data.corporateInformation.embargoDate | local_date
Date Format Syntax
You can format the date to different formats, the syntax is like strf.
%m > month as 01..12
%b > month as Jan…Dec
%Y > year with century as 2021
%y > year without century as 21
Code Block |
---|
{{data.xmpMetadata.xmp.createDate | date: "%Y-%m"}}
Output: 2021-06 |
Code Block |
---|
{{data.xmpMetadata.xmp.createDate | date: "%Y"}}
Output: 2021 |
Code Block |
---|
{{data.xmpMetadata.xmp.createDate | date: "%m, %Y"}}
Output: 06, 2021 |
Use Case
A valid use case is to check if the embargo date is passed and the content can be published:
...