Online User
Online User

Reputation: 17718

How to show the appropriate date in smarty

In my smarty template, {$u.doj} will output the date the user joined my site.

For example,

{$u.doj} will output 2014-06-19 09:41:04.

{$u.doj|nicetime} will output 1 month ago.

How can I output Jun 19, 2014? I'm interested in a easy way using already predefined smarty functions.

Upvotes: 1

Views: 80

Answers (1)

Marcin Nabiałek
Marcin Nabiałek

Reputation: 111869

You can simply use:

{$u.doj|date_format:"%b %d, %Y"}

More you can read at date_format in Smarty reference

Upvotes: 3

Related Questions