Timestamp - Human Readable - Template

55 views
Skip to first unread message

Adalan

unread,
May 30, 2012, 1:26:06 PM5/30/12
to ChicagoBoss
Hey guys,

I've been hunting for the correct method to display an erlang time
on the page via template tags.

Example: {{2012,5,30},{16,45,59}} -> "2012-05-30 13:24:56"

I know the erlydtl function is this:
erlydtl_dateformat:format(erlang:localtime(), "Y-m-d H:i:s"). I just
don't know how to bring that to call that in the template.

I appreciate the help!

Thanks.
Adam

Jose Luis Gordo Romero

unread,
May 30, 2012, 1:46:34 PM5/30/12
to chica...@googlegroups.com
Hi Adam

if your template var is {{ vardate }} just use the date erlydtl filter {{ vardate|date:"Y-m-d H:i:s" }}

Best

--
Jose Luis Gordo Romero



2012/5/30 Adalan <ada...@gmail.com>

Adalan

unread,
May 30, 2012, 1:56:13 PM5/30/12
to ChicagoBoss
Sigh. I don't know how I missed that.

Thank you very much!

On May 30, 1:46 pm, Jose Luis Gordo Romero <jgor...@gmail.com> wrote:
> Hi Adam
>
> if your template var is {{ vardate }} just use the date erlydtl filter {{
> vardate|date:"Y-m-d H:i:s" }}
>
> Best
>
> --
> Jose Luis Gordo Romero
> @jgordor <http://twitter.com/jgordor> -http://www.freemindsystems.com
Reply all
Reply to author
Forward
0 new messages