Extension:TimeZoneInfo
|
TimeZoneInfo Release status: stable |
|
|---|---|
| Implementation | Tag |
| Description | Displays several types of information relating to timezones. |
| Author(s) | JohanTheGhost |
| Last version | 1.0 |
| License | No license specified |
| Download | Version 1.0 |
|
Check usage (experimental) |
|
Contents |
[edit] What can this extension do?
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.
[edit] Usage
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
[edit] Time Zone Chart
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>
[edit] Time Zone Transitions
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 >
[edit] Time Zone List
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/" />
[edit] Installation
- 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
extensionsdirectory asextensions/TimeZoneInfo.php.
[edit] Changes to LocalSettings.php
require_once("$IP/extensions/TimeZoneInfo.php");
