|
|
|
|
![]() ![]() |
Aug 16 2006, 08:09 PM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 498 Joined: 14-November 05 From: Britannia! Member No.: 14,287 |
I noticed a problem on my website a while ago, whereby a clock I'd put onto each page always seemed to put the date 2 months back. The clocks are run by an SSI script that takes the date and time information from the server itself. Of course, the first thing I did was check the script, and I did notice a few problems, in the script, but even after fixing it the date is still two months behind!
I decided to do some investigation on this, and tried to see if I could find out what the server time on Gamma reportedly is. I finally found it when I looked at the php Info. Gamma Server's "Server Time" clock has somehow wound up two months behind, and is now claiming it is June instead of August. This is causing a few problems with my scripts, so if you're not too busy already, can you please look into fixing this for me? |
|
|
|
Aug 18 2006, 01:41 AM
Post
#2
|
|
|
Desperately seeking "any key" to continue... ![]() Group: Admin Posts: 3,463 Joined: 23-April 05 From: Trap17 storage box Member No.: 6,042 |
I am unaware of this issue, so I searched for server time display script.
HTML <script type="text/javascript"> // Current Server Time script (SSI or PHP)- By JavaScriptKit.com (http://www.javascriptkit.com) // For this and over 400+ free scripts, visit JavaScript Kit- [url=http://www.javascriptkit.com/]http://www.javascriptkit.com/[/url] // This notice must stay intact for use. //Depending on whether your page supports SSI (.shtml) or PHP (.php), UNCOMMENT the line below your page supports and COMMENT the one it does not: //Default is that SSI method is uncommented, and PHP is commented: var currenttime = '<!--#config timefmt="%B %d, %Y %H:%M:%S"--><!--#echo var="DATE_LOCAL" -->' //SSI method of getting server date //var currenttime = '<? print date("F d, Y H:i:s", time())?>' //PHP method of getting server date ///////////Stop editting here///////////////////////////////// var montharray=new Array("January","February","March","April","May","June","July","August", "September","October","November","December") var serverdate=new Date(currenttime) function padlength(what){ var output=(what.toString().length==1)? "0"+what : what return output } function displaytime(){ serverdate.setSeconds(serverdate.getSeconds()+1) var datestring=montharray[serverdate.getMonth()]+" " +padlength(serverdate.getDate())+", "+serverdate.getFullYear() var timestring=padlength(serverdate.getHours())+":" +padlength(serverdate.getMinutes())+":"+padlength(serverdate.getSeconds()) document.getElementById("servertime").innerHTML=datestring+" "+timestring } window.onload=function(){ setInterval("displaytime()", 1000) } </script> <p><b>Current Server Time:</b> <span id="servertime"></span></p> <p style="font: normal 11px Arial">This free script provided by<br /> <a href="http://www.javascriptkit.com">JavaScript Kit</a></p> If the above code is the right one to show the server time in SSI, the time displayed using above code shows the correct date and time in GMT+4 from EDT. Check the below link for script in action: buffalohelp.net/servertime.shtml I am also hosted with gamma server. Let me know how this goes. |
|
|
|
Aug 28 2006, 02:59 AM
Post
#3
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 498 Joined: 14-November 05 From: Britannia! Member No.: 14,287 |
The script takes the time from the server itself, so it actually is using the time from wherever the website is based. It is supposed to therefore be in GMT, without any Daylight Saving Changes.
But it isn't a problem with that script - it's a problem with gamma server itself. It's behind by two months, and I don't know how to change it. |
|
|
|
Aug 28 2006, 03:29 AM
Post
#4
|
|
|
Desperately seeking "any key" to continue... ![]() Group: Admin Posts: 3,463 Joined: 23-April 05 From: Trap17 storage box Member No.: 6,042 |
Please read the response I made carefully. The link provided shows in GMT time and date correctly. I was noting that it's GMT time from EDT +4 (GMT+4 from EDT). EDT is Eastern Daylight-saving Time, United States East Coast time zone.
Server time is correctly identified in GMT time and date, repeat. And therefore you must check your script, ini or config setting. There is nothing wrong with the server time. |
|
|
|
Aug 28 2006, 10:54 AM
Post
#5
|
|
|
Incest is a game the whole family can play. ![]() Group: [MODERATOR] Posts: 1,216 Joined: 11-February 05 From: Heaven Member No.: 3,709 |
If the time is exactly 2 months behind then why not fix it the cheap and easy way: open up the file and find the variable which contains the months and add "2" to it.
I've checked as well, the server's time is correct. Are you sure it's not the script? |
|
|
|
Sep 11 2006, 06:17 AM
Post
#6
|
|
|
Desperately seeking "any key" to continue... ![]() Group: Admin Posts: 3,463 Joined: 23-April 05 From: Trap17 storage box Member No.: 6,042 |
Topic seems to be resolved since no more replies.
If you would like to continue this disucssion please PM a moderator. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 29th August 2008 - 11:18 PM |