How to customize the time zone and time display

Supported formats

MyGenesis! uses two time formats, the integer-based, computer-readable "epoch time" and the human-readable ISO 8601 time display.

The integer time is the number of seconds since 1970. It is a monotonically increasing integer that does not vary with Daylight Saving Time or time zone. It is the Unix and Perl native time format, and is inter-operable with the Javascript native time format. MyGenesis! uses this integer time for all time calculations (such as calculating login session duration or for sorting files by last-modified time).

The ISO 8601 standard display is a 19-character string of "Year-Month-Day Hour:Minute:Second". This is the only human-readable time format supported by MyGenesis!.

For example, integer time 1047075651 matches ISO time 2003-03-07 22:20:51.

Customizing human-readable display

Only the ISO 8601 display is supported. This format has the advantages of being standardized, being Y2K-compliant, being purely numeric (thus no need to translate), and of fixed width so that it always fits in display tables as intended.

If the human-readable display must be changed, you can edit subroutine FormatDateTime() in index.pl. This subroutine is always called with format number 12 (the ISO 8601 format) when creating human-readable time displays. Only customize format 12 -- the other formats, such as SMTP and HTTP, need to be retained in their original form, as MyGenesis! uses those formats for other purposes.

Customizing time zone

Limited customization of time zone is supported in MyGenesis! 2.1.0.0029 and newer.

To change the time zone:

  1. Login to MyGenesis! and choose "My Account"

  2. Scroll down to "General Settings" and "Display date and time". Select one of:

    • GMT time -- times will be shown according to the GMT standard (timezone -0000 with no Daylight Saving Time modification). Internally, MyGenesis! calls gmtime().

    • Local time, from web server -- times will be shown according to the local time zone and DST of the web server. Internally, MyGenesis! calls localtime().

    • Local time, from browser -- raw, unformatted integer times will be passed to the client browser. Within the client browser, the FD_LocalTime Javascript function will render the integer time according to the client browser time zone and DST settings.

  3. Save changes. Return to the My Account page and scroll to the bottom to view times in the new time zone format.

For reverse compatibility, the default time zone setting is "Local time, from web server".

Those three options are the only supported options within the web-based admin. The webmaster can also directly edit FormatDateTime() in index.pl to adjust the $offset_in_minutes variable. That can be used to adjust the local time reported by the web server.

Note that for browser-based local time, clients who select this option but who have Javascript disabled in their browsers will see the "local time, from web server" instead.

Note also that time zone information is only used for presenting time strings. It has no bearing on the actual mechanics of the program (which use the native integer time). Changing time zone information will not cause login sessions to timeout or extend, and will not effect the server timestamps of edited files, etc.