TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 17, 2024, 03:55:31 AM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 59
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 50
  • Total: 50

"Today in History" block

Started by Lesmond, October 29, 2005, 01:25:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

adirisman

I have the same problem.

Is there any way to fix this?

JPDeni

Add a temporary line to figure out how much the time is off from what you want. After


$today = mktime();


add


echo 'The time is now ' . date('G:i on j M Y') . '<br />';


Save the block and then go look at it. It should give you a time and date. Figure out the difference between the time displayed and the time you want, in hours. Decide whether you want to add or subtract time. (If you want the time to be later, add. If you want it to be earlier, subtract).

Now go back to your code and delete the line you just added. Change the line


$today = mktime();


to


$alter = 3; // the number of hours you want to adjust the time by. If you want an earlier time, use a negative number
$today = mktime() + (3600 * $alter);

adirisman

Thank you, JPDeni.

That works perfectly.


whitesox

hmm i miss "total posts today" can anyone write 4 me or add 2 this ??

Ken.

Quote from: whitesox on May 13, 2009, 09:22:26 PM
hmm i miss "total posts today" can anyone write 4 me or add 2 this ??
Whitesox, please don't cross post, or double post.
I've already answered you in your other topic and hopefully one of our code specialists will take a look at your request later today or tomorrow.
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.