Jump to content

Template plugin: datetime

Recommended Posts

I customize a Page template, where {datetime="$record->record_publish_date"} is used. The output is:

11. Oktober, 2021 um 19:47 

I need to remove only the time part. I use dateonly parameter for the template plugin datetime

{datetime="$record->record_publish_date" dateonly="true"}

This outputs the date like:


What I need is:

11. Oktober, 2021

Can I achieve it with the datetime plugin? 

Link to comment
Share on other sites

Thank you! In case someone looking for:

{expression="\IPS\DateTime::ts($record->record_publish_date)->format('j. F, Y')"}

This method does not use locales. All output is in English. https://www.php.net/manual/de/datetime.format.php

strFormat does respect locale

{expression="\IPS\DateTime::ts($record->record_publish_date)->strFormat('%e. %B, %Y')"}
Edited by Sonya*
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...