DEV Community

dgloriaweb
dgloriaweb

Posted on

2 1

Smarty date and time formatting

Some examples of date formatting:

{$smarty.now|date_format}
Jun 15, 2022

__ with example date (eg. mysql returned format) __

{$myDate = "2022.06.15 11:01:54"}

{$myDate|date_format}
Jun 15, 2022

{$myDate|date_format:"%D"}
06/15/22

{$myDate|date_format:$config.date}
Jun 15, 2022

{$myDate|date_format:"%A, %B %e, %Y"}
Wednesday, June 15, 2022

{$myDate|date_format:$config.time}
Jun 15, 2022

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay