Author |
Message |
GeekyGuy
Client
![](modules/Forums/images/avatars/455145a540d60199e57fd.gif)
Joined: Jun 03, 2004
Posts: 302
Location: Huber Heights Ohio
|
Posted:
Fri Jul 16, 2004 4:23 pm |
|
I really wouldn't call this a bug, but it is annoying me. I just posted a message to the Shout Box, and the time is off by 3 hours. Shout Box shows 3:02, but I posted it at 6:02.
I have set my time zone in the Forums to GMT-4 hours, which should be correct for my area. Is there another place I should set my timezone? |
_________________ "The Daytona 500 is ours! We won it, we won it, we won it!", Dale Earnhardt, February 15th, 1998, Daytona 500 |
|
![ICQ Number ICQ Number](themes/RavenIce/forums/images/lang_english/icon_icq_add.gif) |
![](themes/RavenIce/forums/images/spacer.gif) |
Tao_Man
Involved
![Involved Involved](modules/Forums/images/ranks/4stars.gif)
![](modules/Forums/images/avatars/0c1fca04410ac30d09c51.gif)
Joined: Jul 15, 2004
Posts: 252
Location: OKC, OK
|
Posted:
Fri Jul 16, 2004 4:28 pm |
|
My setup keys off of system time, which for my host is EDT I would guess that you are east cost and your server is west cost. I have not found a way to set "Nuke time" just in the forums. |
_________________ ------------------------------------------
To strive, to seek, to find, but not to yield!
I don't know Kara-te but I do know cra-zy, and I WILL use it! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Fri Jul 16, 2004 4:34 pm |
|
Look here [ Only registered users can see links on this board! Get registered or login! ] and/or do a search for 'formatTimestamp'. I have posted a method that works with news items and maybe you can modify it to offset your time. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
GeekyGuy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Jul 16, 2004 4:41 pm |
|
As always, you rock. Thanks.
This is the only minor irritation I've encountered, other than the fixes you've already posted.
Thanks again. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
CodyG
Life Cycles Becoming CPU Cycles
![](modules/Forums/images/avatars/186c8977515afcc3ed82a.jpg)
Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island
|
Posted:
Sat Jul 17, 2004 5:57 am |
|
I'm on the westcoast and my server is in Texas, but it's set to EST. I can correct for this in the block-shoutbox.php file, around line 136 ....
Code:if ($Submit == "Shout") {
$test = 0;
$yr = date(Y);
$mnth = date(m);
$dy = date(d);
$day = "$mnth-$dy-$yr";
$h = date(g)-2; // This is the server time. Since it's daylight savings time I use -2, in the fall I'll change it to -3
$m = date(i);
$ap = date(a);
$time = "$h:$m:$ap";
|
Hope that helps. |
_________________ "We want to see if life is ubiquitous." D.Goldin |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
GeekyGuy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jul 17, 2004 9:58 am |
|
CodyG,
That snippet of code is not in the version of block-Shout_Box.php in Ravens 7.3 distro. I think this is the code I need to change, I'm just not sure what/where to change:
Quote: | // date("O"); = difference to GMT. Example: +0800
$sql = "select * from ".$prefix."_shoutbox_date";
$resultD = $db->sql_query($sql);
$rowD = $db->sql_fetchrow($resultD);
$day = date("$rowD[1]");
$time = date("$rowD[2]"); |
I am pretty sure it is in the line: $time = date("$rowD[2]");
But everything I've tried has failed. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
CodyG
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jul 17, 2004 10:52 am |
|
You're right! I obviously do not have the latest version of shoutbox on my other site and I was using that code to show how I had changed the time.
how about this (if you are on east coast and server on westcoast)?
$time=date("$rowD[2]")+3;
?? Did that not work? Maybe something in the php manual about date() would be useful. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
CodyG
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jul 17, 2004 11:01 am |
|
Okies... I'm just guessing at this point, but I got this idea from the manual.
$timeoffset=3;
$servertime = date("$rowD[2]");
$time = $servertime+$timeoffset; |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
GeekyGuy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jul 17, 2004 11:26 am |
|
I've tried using the Offset
date("O")+0300;
both before and after the function, but it makes no changes at all.
I also tried your $timeoffset, and it messes up the time like most of the other things I've tried. It shows:
GeekyGuy: This is a test shout
07-17-2004 13
And it should be :
GeekyGuy: This is a test shout
07-17-2004 10:26am
Which is still showing the server time (PDT instead of EDT) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jul 17, 2004 12:28 pm |
|
You will need to convert the timestamp from the table back to a unixtimestamp and then apply the offset in seconds and then convert it back before displaying it ![Wink](modules/Forums/images/smiles/icon_wink.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
GeekyGuy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jul 17, 2004 12:35 pm |
|
Yup, I'm sure that'll fix it.
(pssst. Hey, anybody know what the hell he just said?)
edit: I am actually searching for a way to do that now |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
CodyG
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jul 17, 2004 12:45 pm |
|
good plan... if I knew what raven what talking about I'd help. ![Wink](modules/Forums/images/smiles/icon_wink.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jul 17, 2004 2:08 pm |
|
d*** rookies
Your date looks like this
So, to alter that you need to convert it back into a unixTimeStamp. Here is a quick-n-dirty routine I just threw together to demonstrate. I know there is a shorter way but I'm on my way out the door and I think this will get you by.Code:<?
$dateS = '07-17-2004 10:26am';
$date = explode(' ',$dateS);
$time = explode('am',$date[1]);
$ampm = $time[1];
$date = explode('-',$date[0]);
$time = explode(':',$time[0]);
$offset = 60*60*3; //offset in seconds
$date = strtotime($date[2].'-'.$date[0].'-'.$date[1].' '.$time[0].':'.$time[1])+$offset;
echo date('Y-m-d h:ia',$date);
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
GeekyGuy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jul 17, 2004 3:29 pm |
|
I've given up on it for today. I've given myself a headache, and I have two cats that are demanding some attention.
Thanks again Raven, you're the best. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
GeekyGuy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Jul 18, 2004 11:18 am |
|
I decided that I really didn't need to show the time a Shout was posted, so I just turned it off in the Shout Box administration.
Problem resolved ![Laughing](modules/Forums/images/smiles/icon_lol.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Jul 18, 2004 1:09 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
GeekyGuy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Jul 18, 2004 1:14 pm |
|
Yuppers!
I need to learn a whole lot more before I attempt that again. I've not had enough time to hit those books.
Raven's probably forgotten more about PHPNuke than I will ever know
![RavensScripts](modules/Forums/images/smiles/ravensphpscripts.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Jul 18, 2004 1:22 pm |
|
I am going to look at this later today because I have nothing else to do and you're such a great guy - Confidence is high - Resolution is near! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
GeekyGuy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Jul 18, 2004 1:28 pm |
|
Most excellent. You are da Man!
I've got to hand it to ya Raven, this distro is awesome. And Coppermine is actually working (didn't work when I installed it on my old setup). I've got some pics of my two cats up on my site now. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|