Author |
Message |
GeekyGuy
Client

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 |
|
 |
 |
Tao_Man
Involved


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! |
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Fri Jul 16, 2004 4:34 pm |
|
|
|
 |
GeekyGuy

|
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. |
|
|
|
 |
CodyG
Life Cycles Becoming CPU Cycles

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 |
|
|
 |
GeekyGuy

|
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. |
|
|
|
 |
CodyG

|
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. |
|
|
|
 |
CodyG

|
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; |
|
|
|
 |
GeekyGuy

|
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) |
|
|
|
 |
Raven

|
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  |
|
|
|
 |
GeekyGuy

|
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 |
|
|
|
 |
CodyG

|
Posted:
Sat Jul 17, 2004 12:45 pm |
|
good plan... if I knew what raven what talking about I'd help.  |
|
|
|
 |
Raven

|
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);
?>
|
|
|
|
|
 |
GeekyGuy

|
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. |
|
|
|
 |
GeekyGuy

|
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  |
|
|
|
 |
Raven

|
Posted:
Sun Jul 18, 2004 1:09 pm |
|
|
|
 |
GeekyGuy

|
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
 |
|
|
|
 |
Raven

|
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! |
|
|
|
 |
GeekyGuy

|
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. |
|
|
|
 |
|