Extension:TimeZoneInfo
![]() | This extension stores its source code on a wiki page. Please be aware that this code may be unreviewed or maliciously altered. They may contain security holes, outdated interfaces that are no longer compatible etc. Note: No localisation updates are provided for this extension by translatewiki.net . |
![]() | This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. |
TimeZoneInfo Release status: unmaintained |
|
---|---|
![]() |
|
Implementation | Tag |
Description | Displays several types of information relating to timezones. |
Author(s) | JohanTheGhost |
Latest version | 1.0 |
License | No license specified |
Download | Version 1.0 |
What can this extension do?[edit]
This extension displays several types of useful (?) information relating to timezones. It is expected to be of some use in Wikis which serve a distributed community of users, where people want to know what time it is for other people.
Usage[edit]
The extension creates three new tags:
<tzchart>
creates a timezone conversion chart<tztrans>
displays standard <--> daylight time transitions<tzlist>
produces a table of all known timezones
Time Zone Chart[edit]
The <tzchart>
tag creates a conversion chart showing the relationships between a number of specified timezones. Timezones with fractional hour offsets (eg. India) are handled quite well.
The tag takes the following parameters:
- align=<table-alignment>
- passed to the generated table
- start=<hour>
- start the chart at the given UTC hour; default 0 (midnight UTC).
The tag text consists of the timezone list, one name per line. Each name may be followed by a user-friendly label, but this is currently unused.
Example:
<tzchart align=right start=2> America/Los_Angeles Europe/Paris Asia/Calcutta </tzchart>
Time Zone Transitions[edit]
The <tztrans>
tag displays a table of standard <--> daylight time transitions for a number of specified timezones, making it easy to see when people in other countries will be changing their clocks.
The tag takes the following parameters:
- align=<table-alignment>
- passed to the generated table
The tag text consists of the timezone list, one name per line. Each name may be followed by a user-friendly label, which will be used in place of the zone name if supplied.
Example:
<tztrans align=right> America/Los_Angeles LA Europe/Paris Paris Asia/Calcutta India </tztrans >
Time Zone List[edit]
The <tzlist>
tag produces a table of all known timezones, or zones whose names match a specified filter.
The tag takes the following parameters:
- filter=<filter-text>
- if supplied, only zones whose name contains the given string are shown.
Any text enclosed within the tag is ignored.
Example:
<tzlist filter="Atlantic/" />
Installation[edit]
- Download the extension code:
- Version 1.0: known to work with PHP 5 and MW 1.9; may work on PHP 4.
- Save the code in your wiki's
extensions
directory asextensions/TimeZoneInfo.php
.
Changes to LocalSettings.php[edit]
require_once("$IP/extensions/TimeZoneInfo.php");