Server time on Boru off by 1 hour (still)

Status
Not open for further replies.

dfb2000

New Member
Messages
8
Reaction score
0
Points
0
My support requests on this issue keep getting closed without resolution, and I see others have reported the same issue. The server time or timezone on Boru is incorrect, is this something we should code around, or is it going to be resolved?

-db
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
Code around it. I will ask staff, but I think it's in the right timezone. What timezone are you in?

~Callum
 

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
It's almost always easiest to just use date_default_timezone_set() with one of the available timezones (UTC is generally recommended), as this ensures that even if the server's time changes (so long as it knows its own timezone) your site will maintain a consistent time across all scripts.
 
Last edited:

dlukin

New Member
Messages
427
Reaction score
25
Points
0
It's almost always easiest to just use date_default_timezone_set() with one of the available timezones (UTC is generally recommended), as this ensures that even if the server's time changes (so long as it knows its own timezone) your site will maintain a consistent time across all scripts.

http://x10hosting.com/forums/free-hosting/136485-help-me-time-display-incorrect.html#post741479

Apparently your servers do not know what time zone they are in. That, or their time setting is off for the timezone they "think" they are in.
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Hello,

Current time in "NewYork" aka EST as of this post: 7:01 PM (x10 itself is located within this timezone)

Stoli: root@stoli [~]# cat /etc/sysconfig/clock
ZONE="America/New_York"
UTC=true
ARC=false
root@stoli [~]# date
Tue Sep 14 19:03:47 EDT 2010
root@stoli [~]#

Starka: root@starka [~]# cat /etc/sysconfig/clock
ZONE="America/New_York"
UTC=true
ARC=false
root@starka [~]# date
Tue Sep 14 19:04:33 EDT 2010

Chopin: root@chopin [~]# cat /etc/sysconfig/clock
ZONE="America/New_York"
UTC=true
ARC=false
root@chopin [~]# date
Tue Sep 14 19:05:40 EDT 2010

Boru: root@boru [~]# cat /etc/sysconfig/clock
ZONE="America/New_York"
UTC=true
ARC=false
root@boru [~]# date
Tue Sep 14 19:06:02 EDT 2010


It all looks good to me.

Reposted from above thread due to the fact there are two open on the same issue.
 

dlukin

New Member
Messages
427
Reaction score
25
Points
0
Why don't you run something from the Web?

I'd don't care what the system clock says. When you run it through Apache and PHP or Perl, it is off by one hour. Period.

Perl:

Code:
#! /usr/bin/perl

use CGI::Carp qw(fatalsToBrowser);



 @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
 @weekDays = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
 ($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, $dayOfYear, $daylightSavings) = localtime();
 $year = 1900 + $yearOffset;
 $theTime = "$hour:$minute:$second, $weekDays[$dayOfWeek] $months[$month] $dayOfMonth, $year";



print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD><TITLE>Time Check</TITLE></HEAD>\n";
print "<BODY>\n";
print "<H2>Time Check</H2> <br /> \n";
print "<H3>$theTime</H3>" ;


print "</BODY>\n";
print "</HTML>\n";

displays:

21:23:30, Tue Sep 14, 2010

It is 5:22 PM Pacific Daylight Time, or 20:22 EDT. Off by 1 hour.

PHP:
PHP:
<?php

$tz=date_default_timezone_get();

echo $tz;
echo "\n\n<br />" ;

$dt = date('l jS \of F Y h:i:s A');

echo $dt ;

exit();

displays:

America/New_York
Tuesday 14th of September 2010 09:27:10 PM

Again, an hour off.

Maybe your servers have the right time, but when it gets to PHP or Perl, they are off by an hour.
 

dfb2000

New Member
Messages
8
Reaction score
0
Points
0
As dlukin says, something is getting lost in translation by the time PHP determines the date. It seems like a timezone or daylight savings time issue.

-db
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
I doubt the servers actually listen to daylight saving time - it has a habit of killing servers (apparently)

~Callum
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
I doubt the servers actually listen to daylight saving time - it has a habit of killing servers (apparently)

~Callum

Just backing this up - a private server I used to play with for Ultima Online had an issue every time the DST would jump forward 1 hour - for that 1 hour, no one could connect because it'd time you out for being idle 1 hour right away. I've seen similar issues on other servers that follow DST as well - if you're lucky it only does it on spring ahead, but the same Ultima Online servers had issues on the fall back side of it - you'd have dozens upon dozens of accounts standing doing nothing but who had logged out 30 minutes earlier >_<

And right now, we're in Spring-Ahead-Fall-Behind; we're at DST +1hr right now, so when the server kicks back a time 1 hour off, that's why - the server won't follow DST because stuff gets screwed up in a hurry when the times change, but it -is- correct.

My recommendation is see if there's a way to determine if DST should be on, and if it is, have your script compensate either by changing timezones or by adding/subtracting whatever you need to for it to be right.
 
Last edited:

dlukin

New Member
Messages
427
Reaction score
25
Points
0
If the server doesn't change for DST, why, according to Brandon, is it showing the correct DST time?

Maybe the server time should be set to Standard Time?

---------- Post added at 12:26 PM ---------- Previous post was at 10:46 AM ----------

Hello,

Current time in "NewYork" aka EST as of this post: 7:01 PM (x10 itself is located within this timezone)

Just realized. It look like you posted this at 7.07 EDT
 

dfb2000

New Member
Messages
8
Reaction score
0
Points
0
I'll just file this away in the 'you get what you pay for' folder (although, I must say, I don't pay for the same service elsewhere and the time returns correctly there! :).

Other than this, I've had no real issues with x10hostings free service (and I lived through the big move saga!), it's an excellent option for hobby work.

-db
 
Status
Not open for further replies.
Top