- This topic has 8 replies, 3 voices, and was last updated 9 years ago by
kiwi.
Tags: 2.0 administration pages
-
1st March 2014 at 10:24 am #2292
Nigel:
Finally got the update done. Thanks for a great job! I really like the Unlinked Individuals and Fancy Imagebar features.
One issue; it appears the values for UTC and Server times in the Administration pages are turned around or are mislabeled.
Thanks again.
Roy Evans
Roy
Apache 2.4.27 PHP 7.19 MariaDB 10.2.8
-
2nd March 2014 at 1:38 pm #2297
Roy
Sorry, but I don’t think so. They appear to be correct, and are identical to Greg’s code in webtrees. Perhaps some explanation will help.
UTC is defined here by the code
format_timestamp(WT_TIMESTAMP)
WT_TIMESTAMP is taken from
(int)WT_DB::prepare("SELECT UNIX_TIMESTAMP()")->fetchOne());
This is a standard MySQL function that The above statement will return the unix timestamp in seconds as an unsigned integer since ‘1970-01-01 00:00:00’ UTC. (See more at: W3 Resource)“format_timestamp(WT_TIMESTAMP)” simply restates that time-stamp as a human-readable date. You can check the code for that in /includes/functions/function_date.php, line 88.
Server time is fairly similar. It starts with
format_timestamp(WT_SERVER_TIMESTAMP)
.WT_SERVER_TIMESTAMP is
WT_TIMESTAMP + (int)date('Z')
Date(‘Z’) is the standard PHP date function which provides the timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. To do this it does require that date.timezone is correctly set to your locale in your php.ini file. I assume that is correct in your case? You can check it in Administration > PHP info.
Nigel
My personal kiwitrees site is www.our-families.info -
3rd March 2014 at 10:46 am #2302
Nigel:
This has me stumped. Am sending you an excerpt from the PHP report by email. Didn’t want to post it here because it contains my exact Lat/Long.
Php.ini is correct. The kiwitrees’ PHP report is correct. The time on the server and client are both correct. The server and client are both in the -5 time zone. But the administration pages show:
kiwitrees 2.0
Server time — 2 March 2014 – 7:31:40 p.m.
Client time — 2 March 2014 – 12:31:42 p.m.
UTC — 2 March 2014 – 12:31:42 p.m.What I expect to see is:
kiwitrees 2.0
Server time — 2 March 2014 -12:31:42 p.m.
Client time — 2 March 2014 – 12:31:42 p.m.
UTC — 2 March 2014 – 7:31:40 p.m.Will send the PHP report excerpt shortly.
Roy
Roy
Apache 2.4.27 PHP 7.19 MariaDB 10.2.8
-
3rd March 2014 at 11:37 am #2303
Can you run the MYSQL function “SELECT UNIX_TIMESTAMP()” on your server and tell me what the result is.
Nigel
My personal kiwitrees site is www.our-families.info -
4th March 2014 at 7:58 am #2307
Nigel:
It came me a return of 1,393,872,752
I ran the query 1:53PM on 3/3/2014.
I am pretty sure the timestamp is correct.
Roy Evans
Roy
Apache 2.4.27 PHP 7.19 MariaDB 10.2.8
-
4th March 2014 at 8:32 am #2310
That number converts to
Mon, 03 Mar 2014 18:52:32 GMT
(If you want to redo this test yourself, a good place to convert Unix timestamps is http://www.onlineconversion.com/unix_time.htmAs you are 5 hours behind UTC that does give the correct local time.
So at that time your admin panel should have shown:Server time – 1:53PM on 3/3/2014
Client time – 1:53PM on 3/3/2014
UTC – 6:53PM on 3/3/2014If that was not the case then I do not see how, EXCEPT if you have the wrong version of one or more files. Try first clearing your browser cache, then if that doesn’t work try re-uploading these files:
/includes/session.php
/includes/functions/functions_date.php
/themes/administration/header.phpThese files were modified at this latest version (as they were in webtrees 1.5.2) to correct an error in the calculation.
Nigel
My personal kiwitrees site is www.our-families.info -
5th March 2014 at 7:40 am #2321
Nigel:
I think I will just ignore the administrative page times.
I had cleared the caches several times. Downloaded a new copy of kiwitrees 2.0 and uploaded the recommended files with no change.
Server shows correct time zone and time. It is correctly time stamping it’s logs. The kiwitrees’ logs are correctly time stamped. The kiwitrees PHP report is correct. Client shows correct time zone and time. Its logs are correctly time stamped.
Don’t think it is worth any more time, yours and mine, chasing this demon.
Thanks for all your help.
Roy Evans
Roy
Apache 2.4.27 PHP 7.19 MariaDB 10.2.8
-
5th March 2014 at 9:36 am #2326
One of the danish users (Ole Madsen) have seen the time translation is wrong
%G:%i:%s instead of %g:%i:%s %a
Perhabs the same problem here?
Regards, Jamie Jaconelli
admin and owner of a user customized version of kiwitrees (contains 3 family trees)
-
5th March 2014 at 10:20 am #2327
A good thought, but sadly no. The en_US is definitely %g:%i:%s %a which is correct.
The default in the code (/library/WT/I18N.php) is actually %H:%i:%s but then each language, including en_US has their own translation. For American it translates to %g:%i:%s %a
H = 24-hour format of an hour with leading zeros 00 through 23
G = 24-hour format of an hour without leading zeros 0 through 23
g = 12-hour format of an hour without leading zeros 1 through 12
(the %a at the end adds the “am/pm” suffix)But all of these are just for display anyway. They don’t change the underlying time calculation.
Nigel
My personal kiwitrees site is www.our-families.info
- The topic ‘2.0 UTC/Server Time’ is closed to new replies.