-
Add a link on the Dynamic Data documentation in the Current Date fields section to the PHP Date Time Formats docs for easy reference to all the possibilities
-
Add
{current_date:U}
to the list of examples for Current Date fields as it can be very useful when needing to add a comparison condition for custom date fields using unix timestamps
For context as to why I bring this improvement up… I was struggling the other day with trying to add a condition to an element for comparing a custom field saved as Unix (epoch) timestamps with the current date. I was only familiar with displaying dates in certain formats in the frontend but never had to do a conditional statement with timestamps yet. Took me a longer than I care to admit, but I finally discovered and got it to work with a {current_date:U}
value where U
represents Unix timestamps. I had read through the Bricks documentation on Dynamic Data and saw that it allowed for PHP date formats, and it gave plenty of examples so I presumed that was all the available options before realizing there were a lot more.
I figured this small improvement could maybe help others in the future. At the very least hopefully this post itself can help people too.