%META:TOPICINFO{author="TWikiContributor" date="1366696222" format="1.1" version="1"}%
---+!! <nop>%TOPIC%
<!--
   Contributions to this plugin are appreciated. Please update the plugin page at
   http://twiki.org/cgi-bin/view/Plugins/LocalCityTimePlugin or provide feedback at
   http://twiki.org/cgi-bin/view/Plugins/LocalCityTimePluginDev.
   If you are a TWiki contributor please update the plugin in the SVN repository.
-->
<sticky>
<div style="float:right; background-color:#EBEEF0; margin:0 0 20px 20px; padding: 0 10px 0 10px;">
%TOC{title="Page contents"}%
</div>
</sticky>
%SHORTDESCRIPTION%

---++ Introduction

This plugin shows the local time of a city embedded in a %WIKITOOLNAME% topic. The current local time is taken from the Date and Time Gateway at http://TWiki.org/cgi-bin/xtra/tzdate, or calculated internally.

---++ Syntax Rules

Add the =%<nop>LOCALCITYTIME{"timezone"}%= variable anywhere in your topic. ="timezone"= is a Continent/City combination as defined in the Date and Time Gateway page.

Examples:

| *What:* | *You type:* | *You get: (static text for demo)* |
| Time in Zurich: | =%<nop>LOCALCITYTIME{"Europe/Zurich"}%= | Sun, 15 Jul 2001, 02:03:50 CEST (<a href="http://www.bsdi.com/date?Europe/Zurich">Europe/Zurich</a>) |
| Incorrect timezone: | =%<nop>LOCALCITYTIME{"Not/There"}%= | %TOPIC% warning: Invalid Timezone. Use a Continent/City timezone code listed in http://TWiki.org/cgi-bin/xtra/tzdate, e.g. %<nop>LOCALCITYTIME{"Europe/Zurich"}% |
| Help: | =%<nop>LOCALCITYTIME%= | %LOCALCITYTIME% |

---++ <nop>%TOPIC% Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write ==%<nop>&lt;plugin&gt;_&lt;setting&gt;%==, i.e. ==%<nop>LOCALCITYTIMEPLUGIN_SHORTDESCRIPTION%==

   * One line description, is shown in the %SYSTEMWEB%.TextFormattingRules topic:
      * Set SHORTDESCRIPTION = Shows the local time of a city embedded in a TWiki topic

   * Debug plugin: (See output in =data/debug.txt=)
      * Set DEBUG = 0

   * Use internal date command instead of Date and Time Gateway. This is faster, but depends on BSD / Linux style zoneinfo files and the =date= command:
      * Set USEDATECOMMAND = 0

---++ Plugin Installation Instructions

__Note:__ You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running. 
%TWISTY{
 mode="div"
 showlink="Show details %ICONURL{toggleopen}% "
 hidelink="Hide details %ICONURL{toggleclose}% "
}%

   * Download the ZIP file from the Plugin web (see below)
   * Unzip ==%TOPIC%.zip== in your twiki installation directory. Content:
     | *File:* | *Description:* |
     | ==data/TWiki/%TOPIC%.txt== | Plugin topic |
     | ==data/TWiki/%TOPIC%.txt,v== | Plugin topic repository |
     | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
   * (Dakar) Visit =configure= in your TWiki installation, and enable the plugin in the {Plugins} section.
   * Check if the following =%<nop>LOCALCITYTIME{"Europe/Zurich"}%= works:
      * %LOCALCITYTIME{"Europe/Zurich"}%
   * Optionally enable internal date calculation with the =USEDATECOMMAND = 1= setting. This is faster then getting the data from the Date and Time Gateway page, but it depends on BSD / Linux style zoneinfo files and the =date= command; configure the =$tzDir=, =$dateCmd=, =$dateParam= settings in =twiki/lib/TWiki/Plugins/LocalCityTimePlugin.pm= in case needed.

%ENDTWISTY%

---++ Plugin Info

%TABLE{ tablewidth="100%" columnwidths="170," }%
|  Plugin Author: | TWiki:Main.PeterThoeny |
|  Copyright: | &copy; 2001-2013 Peter Thoeny %BR% &copy; 2001-2013 TWiki:TWiki.TWikiContributor |
|  License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
|  Plugin Version: | 2013-04-22 |
%TWISTY{
 mode="div"
 showlink="Show Change History %ICONURL{toggleopen}%"
 hidelink="Hide Change History %ICONURL{toggleclose}% "
}%
%TABLE{ tablewidth="100%" columnwidths="170," }%
|  2013-04-22: | TWikibug:Item7154: Use TWISTY in installation instructions section and change history; add VarLOCALCITYTIME variable doc topic |
|  2011-07-13: | TWikibug:Item6725: Change global package variables from "use vars" to "our" |
|  2010-08-01: | TWikibug:Item6530: Doc fixes; changing TWIKIWEB to SYSTEMWEB |
|  19 Nov 2004: | Minor code cleanup; added benchmarks |
|  23 Nov 2003: | New URL for gateway (www.bsdi.com is decommissioned); choice of internal date calculation |
|  14 Jul 2001: | Changed to plug & play |
|  26 Apr 2001: | initPlugin returns 1; fixed uninitialized value warning |
|  25 Apr 2001: | Initial version |
%ENDTWISTY%
%TABLE{ tablewidth="100%" columnwidths="170," }%
|  CPAN Dependencies: | none |
|  Other Dependencies: | If =USEDATECOMMAND = 0=: Format of Date and Time Gateway web page at http://TWiki.org/cgi-bin/xtra/tzdate <br />Else: BSD or Linux zoneinfo files and date command |
|  Perl Version: | 5.0 |
|  [[TWiki:Plugins/Benchmark][Plugin Benchmarks]]: | %SYSTEMWEB%.GoodStyle 99%, %SYSTEMWEB%.FormattedSearch 99%, LocalCityTimePlugin with internal date command 96%, without 55% |
|  Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% |
|  Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev |
|  Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Appraisal |

__Related Topics:__ VarLOCALCITYTIME, %SYSTEMWEB%.TWikiPreferences, %SYSTEMWEB%.TWikiPlugins, %SYSTEMWEB%.TextFormattingRules
