1
Phasma
Date and Time SMARTY Variable
  • 2004/4/14 20:58

  • Phasma

  • Just popping in

  • Posts: 9

  • Since: 2004/2/29


is there a date and time smarty variable within xoops, if not how would I go about creating it?

2
Mithrandir
Re: Date and Time SMARTY Variable

Smarty Time functions

Should work with XOOPS as well

3
fatman
Re: Date and Time SMARTY Variable
  • 2004/4/14 21:07

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


// in your php file
$xoopsTpl->assign('current_date'time());



<{$current_date|date_format}>


Is one way to it. You could stick the php in your /footer.php file and then the smarty tag would be available to all your pages.


HTH

4
Mithrandir
Re: Date and Time SMARTY Variable

<{$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}> is easier, isn't it?

5
fatman
Re: Date and Time SMARTY Variable
  • 2004/4/14 23:03

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


Quote:

Mithrandir wrote:
<{$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}> is easier, isn't it?


I never knew about $smarty.now until I saw your reply above, but by then I had already hit send on my suggestion :P

your way certainly is much easier

Login

Who's Online

134 user(s) are online (117 user(s) are browsing Support Forums)


Members: 0


Guests: 134


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits