1
Burnzy
Smarty Time set to -6 gmt
  • 2005/1/31 3:25

  • Burnzy

  • Just popping in

  • Posts: 75

  • Since: 2005/1/23


I have Smarty date and time format on my site and it has it as 9:44 when it is 10:44 where i am. How can i make that right?

Then i also have my time in my newbb forum saying 21:44 which is 9:44 pm. I have my personal settings set to -5 which is eastern... then i changed them to -4 and it went to the right time, 22:44.... wtf? Can sumone help me please?

2
Burnzy
Re: Smarty Time set to -6 gmt
  • 2005/1/31 19:26

  • Burnzy

  • Just popping in

  • Posts: 75

  • Since: 2005/1/23


please?

3
Burnzy
Re: Smarty Time set to -6 gmt
  • 2005/2/1 3:36

  • Burnzy

  • Just popping in

  • Posts: 75

  • Since: 2005/1/23


My code is:
<{$smarty.now|date_format:"%A, %B %e, %Y, %l:%M:%S%p"}>

and i get the output of: Monday, January 31, 2005, 9:40PM

I want it to have 10:40PM... how do i add 1 hour to it?

4
Dave_L
Re: Smarty Time set to -6 gmt
  • 2005/2/1 3:49

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


$smarty.now is in seconds, so you would add 3600 to that value before applying the date_format modifier. I don't remember the Smarty syntax for doing that offhand.

5
Burnzy
Re: Smarty Time set to -6 gmt
  • 2005/2/1 3:59

  • Burnzy

  • Just popping in

  • Posts: 75

  • Since: 2005/1/23



6
Dave_L
Re: Smarty Time set to -6 gmt
  • 2005/2/3 15:48

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


<{$smarty.now+3600|date_format:"%A, %B %e, %Y, %I:%M:%S%p"}>

7
kavaXtreme
Re: Smarty Time set to -6 gmt
  • 2005/2/9 22:52

  • kavaXtreme

  • Repository Maintainer

  • Posts: 110

  • Since: 2005/1/17


Very helpful thread. Any explanation as to why smarty.now doesn't use the time as indicated in my XOOPS preferences?

I need to add 2 hours, but adding +7200 just causes the page to stop loading when it comes to that point. What am I doing wrong?

8
script_fu
Re: Smarty Time set to -6 gmt

I've always wondered why my time was off an hour. Would someone point me to the files that need to be changed. Its easy for the people who already know where to go but I don't and im sure others don't either...

Thanks...

9
kavaXtreme
Re: Smarty Time set to -6 gmt
  • 2005/2/23 11:11

  • kavaXtreme

  • Repository Maintainer

  • Posts: 110

  • Since: 2005/1/17


It needs to be changed in your theme. Which part of the theme you want to modify depends on you and on which theme you are using. In my case I added the smarty.now tag to theme.html in my default theme. This would be found at http://www.your_site.com/themes/default/theme.html.

Now back to me: can anyone PLEASE tell me how to add two hours to the smarty.now tag? As I mentioned before, the +7200 thing just makes my page stop loading at that point. Is there a way to make Smarty pull the time info from XOOPS and not the server? That would be ideal.

Login

Who's Online

330 user(s) are online (220 user(s) are browsing Support Forums)


Members: 0


Guests: 330


more...

Donat-O-Meter

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

Latest GitHub Commits