Extension:TimeConvert
From Linux Web Expert
<translate> This extension is currently not actively maintained!</translate> <translate> Although it may still work, any bug reports or feature requests will more than likely be ignored.</translate> |
TimeConvert Release status: unmaintained |
|
---|---|
Implementation | Parser function |
Description | Provides a parser function and Scribunto Lua library to convert a time to a different time zone |
Author(s) | dlhtalk |
MediaWiki | 1.18+ |
PHP | 5.2+ |
Database changes | No |
License | MIT License |
Download | GitHub:
<translate> Note:</translate> README |
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
The TimeConvert extension provides a parser function and Scribunto Lua library to convert a time to a different time zone.
Examples
{{#timeconvert:2014-01-01 13:00 GMT|America/New_York}} => 2014-01-01T08:00:00-0500 {{#timeconvert:2014-01-01 13:00 GMT|America/New_York|g:i A}} => 8:00 AM {{#timeconvert:2014-01-01 8:00 AM EST|Etc/GMT|G:i}} => 13:00
Documentation
{{#timeconvert:date time|time zone|format}}
date time
: A date time string.time zone
: The time zone to convertdate time
to.format
: The output format to use. The default is ISO 8601.
Scribunto Lua Library
TimeConvert provides a Scribunto library, mw.ext.timeconvert
. Examples:
local timeconvert = mw.ext.timeconvert.timeconvert timeconvert("2014-01-01 13:00 GMT", "America/New_York") => "2014-01-01T08:00:00-0500" timeconvert("2014-01-01 13:00 GMT", "America/New_York", "g:i A") => "8:00 AM" timeconvert("2014-01-01 8:00 AM EST", "Etc/GMT", "G:i") => "13:00"
Installation
- <translate> <tvar name=1>Download</tvar> and place the file(s) in a directory called <tvar name=name>
TimeConvert
</tvar> in your <tvar name=ext>extensions/
</tvar> folder.</translate> - <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
require_once "$IP/extensions/TimeConvert/TimeConvert.php";
- File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>
Categories:
- Pages with script errors
- Pages with broken file links
- Unmaintained extensions
- Extensions without an image
- Parser function extensions
- Extensions without a compatibility policy
- Extensions with manual MediaWiki version
- MIT licensed extensions
- Extensions in GitHub version control
- ParserFirstCallInit extensions
- ScribuntoExternalLibraries extensions
- All extensions
- Extensions not in ExtensionJson
- Extensions not using extension registration