Search Forums
Forums
Kiwitrees on Twitter
    Tags

    add missing death, census, internal messaging, ID facts, release, wish, ID notes, fixing errors, ASSO, 3.2.0, lists, message contactform, married, descendants, research tasks, bug, error, fancy tree view, themes, 3.0.0, Extra menus, flags, kiwitrees 2.0.2, hover, duplicates, emigration, Batch Updates, 3.2.1, MAC, charts, chart, kiwitrees, googlemap. modified, session, autocomplete, permissions, 3.2.2, source, media, add_asso_facts, 1939 Register, beta, dead, design, version, individual resource, tools, html, 3.1.1, research, last change date, defacto, cookie, folder, styles, Favourites, multiple marriages, .po, administration pages, time

    #2297
    kiwi
    kiwi
    Keymaster

    1545 posts

    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