|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
smowtion Smarty n00b
Joined: 13 Mar 2013 Posts: 4
|
Posted: Tue Apr 22, 2014 2:24 pm Post subject: How do I convert datetime to ISO 8601 in smarty |
|
|
How do I convert my time to ISO 8601 date format?
in php
Code: |
$datetime = new DateTime('2010-12-30 23:21:46');
echo $datetime->format(DateTime::ISO8601);
|
or
Code: | echo date("c",time()); |
Can i do it in smarty with date_format
Thanks |
|
Back to top |
|
smowtion Smarty n00b
Joined: 13 Mar 2013 Posts: 4
|
Posted: Tue Apr 22, 2014 2:37 pm Post subject: |
|
|
sorry
I founded a solution
Code: | {"c"|date:$smarty.now} |
close |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Apr 23, 2014 3:38 am Post subject: |
|
|
you might also try:
{$smarty.now|date_format:"c"}
date_format will support date() formats as well as strftime(). If there are no "%" chars, date() is assumed. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|