Server time

Found a bug? Tell us!!
chickens
Regular
Posts: 192
Joined: Wed Dec 06, 2006 12:15 am
Location: Vegas
Contact:

Post by chickens »

There is a very simple way of telling the time of the server. Create a file called time.php (or whatever you want) and put this code in it

Code: Select all

 <?php print date("F j, Y, G:i:s"); ?> 
Upload it to your server and run it. This will show you the exact time and date on your server in the following format: December 14, 2006, 21:20:51 pm

Once you get the exact time difference between your time and the servers time you can make the offset whatever you would like. So, if the server's time is truly 24 hours off you can do a +24 to get the day accurate. I did not test this nor look at the code to verify this will work correctly. I am just working off my PHP experiences in the past.
jdrodrigues
Regular
Posts: 36
Joined: Sun Feb 12, 2006 9:27 pm
Location: London
Contact:

Post by jdrodrigues »

No, it doesn't make any difference.

Here's the result of the date cmd on the Pair server:

Fri Dec 15 05:18:48 EST 2006

And the date on my computer is:

Fri Dec 15 10:19:13 GMT 2006


OK, I've just checked and think I know what has happened.

I made an entry with the date "2006-12-12 00:00". After saving, I opened the same entry for editing and the date is now "2006-12-11 20:00"

So I just did this:

UPDATE serendipity_entries SET timestamp = (timestamp + 18000);

And it seems OK now.
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Phew! Glad this one is solved. Now for the fly in the ointment: does it work for new entries, too?
Judebert
---
Website | Wishlist | PayPal
jdrodrigues
Regular
Posts: 36
Joined: Sun Feb 12, 2006 9:27 pm
Location: London
Contact:

Post by jdrodrigues »

Yes, new entries work just fine. I was confused about this, because since I thought using "05:00" for the server offset wasn;t working (I was only looking at pre-existing entries), I had removed the offset. So, even the new entries were being saved at -5 hours. I have now reinserted the "05:00" offset and all is well.

Thanks again !
mehulved
Regular
Posts: 8
Joined: Sun Jun 03, 2007 9:45 am

Post by mehulved »

I am using serendipity-1.1.2 while posting I saw that the server time was 10:30 hrs behind my local time. So, I tried to correct it but it didn't work. Searching for it I reached this thread. Finally I realised that I needed to give 10.5 instead or 10:30 to get the correct time on my blog. Now, this is quite a non-standard way, atleast for me. As I've learnt, it should always be hh:mm so can the future releases have it that way so it becomes easier to figure?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

If we were to change that to "10:30" it would mean that installations would break were people already entered "10.30".

Also, the setup instructions say: "'Enter the amount of hours between". So there's nothing said about "minutes" which uses your notatiion. Thus, 10.5 is expected and clear, IMHO?

Thanks though for mentioning this issue!

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mehulved
Regular
Posts: 8
Joined: Sun Jun 03, 2007 9:45 am

Post by mehulved »

garvinhicking wrote:Hi!

If we were to change that to "10:30" it would mean that installations would break were people already entered "10.30".
Anyway to have a hh:mm format in the future because most of the software out there follows that format, too. That if the developers do agree that it will be better to have hh:mm format.
garvinhicking wrote: Also, the setup instructions say: "'Enter the amount of hours between". So there's nothing said about "minutes" which uses your notatiion. Thus, 10.5 is expected and clear, IMHO?
Yeah that is quite clear now.
garvinhicking wrote: Thanks though for mentioning this issue!

Best regards,
Garvin
And thanks for your time and efforts too.
Post Reply