Sonya* Posted October 12, 2021 Share Posted October 12, 2021 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: 11.10.2021 What I need is: 11. Oktober, 2021 Can I achieve it with the datetime plugin? Link to comment Share on other sites More sharing options...
Adriano Faria Posted October 12, 2021 Share Posted October 12, 2021 There's no "format" in the datetime plugin. You can use: {expression="\IPS\DateTime::ts( time() )->format('Y/m/d')"} Sonya* and SeNioR- 1 1 Link to comment Share on other sites More sharing options...
Sonya* Posted October 12, 2021 Author Share Posted October 12, 2021 (edited) 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 October 12, 2021 by Sonya* WP V0RT3X and Maxxius 1 1 Link to comment Share on other sites More sharing options...
Recommended Posts