PPF Home
Plugins
Developers
   Font size:      

Time (v1.0)

PDF
PDF

Description

Keeps track of users' time zones, and lets other users query the bot for the current time in their location. Also shows information on time zones, and the current time in a given zone - with convenience commands for GMT and UTC.

An example of usage for showing other people's timezones:
First, user A sets their timezone: !setTZ Europe/Oslo
Later, user B wants to know the current time for user A, so asks the bot: !time A
User B will then be told the current time in user A's timezone (in this case Europe/Oslo).

In other words, the plugin will not find people's timezones automagically, they will have to set which time zone they are in manually before the bot can be queried about them.

Note that this plugin uses only nicknames to separate users - so if someone has several nicks they use, they will have to set their timezone for each one individually if they want people to get results no matter which nick is being used to query the bot.

This plugin uses Java's timezone information classes, so timezones have to be specified using the same names as Java uses.

Configuration

The configuration file for this plugin is system/Time/TimeConfig.xml

commandReadTime

The command for giving the current time for for a given user or timezone.
You can set the authLevel to control who is allowed to access the command. The output is used to define where the output from the command will go.

  • authLevel - ANY, ADMIN, MASTER, TRUSTED, NONE
  • output - CHANNEL, PM, NOTICE

        <commandReadTime authLevel="none" output="channel">!time</commandReadTime>

      

commandSetOwnTZ

The command for setting which time zone you are in.
You can set the authLevel to control who is allowed to access the command. The output is used to define where the output from the command will go.

  • authLevel - ANY, ADMIN, MASTER, TRUSTED, NONE
  • output - CHANNEL, PM, NOTICE

        <commandSetOwnTZ authLevel="none" output="channel">!setTZ</commandSetOwnTZ>

      

commandFindTZ

The command for finding a timezone(searching through them).
You can set the authLevel to control who is allowed to access the command. The output is used to define where the output from the command will go.

  • authLevel - ANY, ADMIN, MASTER, TRUSTED, NONE
  • output - CHANNEL, PM, NOTICE

        <commandFindTZ authLevel="none" output="channel">!findTZ</commandFindTZ>

      

commandShowTZ

The command for showing information on a timezone, or which timezone a user is set as being in.
You can set the authLevel to control who is allowed to access the command. The output is used to define where the output from the command will go.

  • authLevel - ANY, ADMIN, MASTER, TRUSTED, NONE
  • output - CHANNEL, PM, NOTICE

        <commandShowTZ authLevel="none" output="channel">!showTZ</commandShowTZ>

      

commandShowGMT

The command for showing the current time in GMT (Greenwich Mean Time).
You can set the authLevel to control who is allowed to access the command. The output is used to define where the output from the command will go.

  • authLevel - ANY, ADMIN, MASTER, TRUSTED, NONE
  • output - CHANNEL, PM, NOTICE

        <commandShowGMT authLevel="none" output="channel">!gmt</commandShowGMT>

      

commandShowUTC

The command for showing the current time in UTC (Coordinated Universal Time).
You can set the authLevel to control who is allowed to access the command. The output is used to define where the output from the command will go.

  • authLevel - ANY, ADMIN, MASTER, TRUSTED, NONE
  • output - CHANNEL, PM, NOTICE

        <commandShowUTC authLevel="none" output="channel">!utc</commandShowUTC>

      

Commands

!time

Command: !time
Description: This will show the current time for the given user, or in the given timezone.
Auth Level: none
Where to give command: channel, pm
Outputs to: same as given
Example(s):

  • !time EdorFaus
  • !time Europe/Oslo
  • !time America/Phoenix

!setTZ

Command: !setTZ
Description: This will set the timezone that you are currently in.
Auth Level: none
Where to give command: channel, pm
Outputs to: same as given
Example(s):

  • !setTZ Europe/Oslo
  • !settz America/Phoenix

!findTZ

Command: !findTZ
Description: This will search for a timezone, either containing the text you give or in the offset you give.
Auth Level: none
Where to give command: channel, pm
Outputs to: same as given
Example(s):

  • !findTZ +3
  • !findTZ +03:30
  • !findTZ Phoenix
  • !findTZ CET

!showTZ

Command: !showTZ
Description: This will show which timezone is set for the given user, or a set of information on the given timezone.
Auth Level: none
Where to give command: channel, pm
Outputs to: same as given
Example(s):

  • !showTZ EdorFaus
  • !showTZ Europe/Moscow

!gmt and !utc

Command: !gmt and !utc
Description: These will return the current time in GMT (Greenwich Mean Time) and UTC (Coordinated Universal Time) respectively.
Auth Level: none
Where to give command: channel, pm
Outputs to: same as given
Example(s):

  • !gmt
  • !utc

Change History

v1.0 First Version by EdorFaus