Overview

Namespaces

  • Budabot
    • Core
      • Modules
    • User
      • Modules
  • None
  • Tyrence
    • Modules

Classes

  • AccessLevel
  • Budabot\Core\AccessManager
  • Budabot\Core\AdminManager
  • Budabot\Core\AOChat
  • Budabot\Core\AOChatPacket
  • Budabot\Core\AOChatQueue
  • Budabot\Core\AOExtMsg
  • Budabot\Core\AsyncHttp
  • Budabot\Core\AutoInject
  • Budabot\Core\BotRunner
  • Budabot\Core\Budabot
  • Budabot\Core\BuddylistManager
  • Budabot\Core\CacheManager
  • Budabot\Core\CacheResult
  • Budabot\Core\ClassLoader
  • Budabot\Core\ColorSettingHandler
  • Budabot\Core\CommandAlias
  • Budabot\Core\CommandManager
  • Budabot\Core\ConfigFile
  • Budabot\Core\DB
  • Budabot\Core\DBRow
  • Budabot\Core\EventLoop
  • Budabot\Core\EventManager
  • Budabot\Core\GuildChannelCommandReply
  • Budabot\Core\GuildManager
  • Budabot\Core\HelpManager
  • Budabot\Core\Http
  • Budabot\Core\HttpRequest
  • Budabot\Core\LegacyLogger
  • Budabot\Core\LimitsController
  • Budabot\Core\LoggerWrapper
  • Budabot\Core\MMDBParser
  • Budabot\Core\Modules\AdminController
  • Budabot\Core\Modules\AliasController
  • Budabot\Core\Modules\AltInfo
  • Budabot\Core\Modules\AltsController
  • Budabot\Core\Modules\BanController
  • Budabot\Core\Modules\BuddylistController
  • Budabot\Core\Modules\ColorsController
  • Budabot\Core\Modules\CommandlistController
  • Budabot\Core\Modules\CommandSearchController
  • Budabot\Core\Modules\ConfigController
  • Budabot\Core\Modules\EventlistController
  • Budabot\Core\Modules\HelpController
  • Budabot\Core\Modules\LogsController
  • Budabot\Core\Modules\PlayerLookupController
  • Budabot\Core\Modules\ProfileCommandReply
  • Budabot\Core\Modules\ProfileController
  • Budabot\Core\Modules\SettingsController
  • Budabot\Core\Modules\SQLController
  • Budabot\Core\Modules\SystemController
  • Budabot\Core\Modules\UsageController
  • Budabot\Core\Modules\WhitelistController
  • Budabot\Core\NumberSettingHandler
  • Budabot\Core\OptionsSettingHandler
  • Budabot\Core\PlayerHistory
  • Budabot\Core\PlayerHistoryManager
  • Budabot\Core\PlayerManager
  • Budabot\Core\Preferences
  • Budabot\Core\PrivateChannelCommandReply
  • Budabot\Core\PrivateMessageCommandReply
  • Budabot\Core\Registry
  • Budabot\Core\SettingHandler
  • Budabot\Core\SettingManager
  • Budabot\Core\SettingObject
  • Budabot\Core\SocketManager
  • Budabot\Core\SocketNotifier
  • Budabot\Core\SubcommandManager
  • Budabot\Core\Text
  • Budabot\Core\TextSettingHandler
  • Budabot\Core\Timer
  • Budabot\Core\TimerEvent
  • Budabot\Core\TimeSettingHandler
  • Budabot\Core\Util
  • Budabot\Core\xml
  • Budabot\User\Modules\AlienArmorController
  • Budabot\User\Modules\AlienBioController
  • Budabot\User\Modules\AlienMiscController
  • Budabot\User\Modules\AOSpeakController
  • Budabot\User\Modules\AOUController
  • Budabot\User\Modules\AXPController
  • Budabot\User\Modules\BankController
  • Budabot\User\Modules\BosslootController
  • Budabot\User\Modules\BroadcastController
  • Budabot\User\Modules\BuffPerksController
  • Budabot\User\Modules\CacheController
  • Budabot\User\Modules\ChatAssistController
  • Budabot\User\Modules\ChatCheckController
  • Budabot\User\Modules\ChatLeaderController
  • Budabot\User\Modules\ChatRallyController
  • Budabot\User\Modules\ChatSayController
  • Budabot\User\Modules\ChatTopicController
  • Budabot\User\Modules\CityWaveController
  • Budabot\User\Modules\CloakController
  • Budabot\User\Modules\ClusterController
  • Budabot\User\Modules\CountdownController
  • Budabot\User\Modules\DevController
  • Budabot\User\Modules\DingController
  • Budabot\User\Modules\EventsController
  • Budabot\User\Modules\FightController
  • Budabot\User\Modules\FindOrgController
  • Budabot\User\Modules\FindPlayerController
  • Budabot\User\Modules\FunController
  • Budabot\User\Modules\GitController
  • Budabot\User\Modules\GuideController
  • Budabot\User\Modules\GuildController
  • Budabot\User\Modules\HelpbotController
  • Budabot\User\Modules\HtmlDecodeController
  • Budabot\User\Modules\ImplantController
  • Budabot\User\Modules\ImplantDesignerController
  • Budabot\User\Modules\InactiveMemberController
  • Budabot\User\Modules\ItemsController
  • Budabot\User\Modules\KillOnSightController
  • Budabot\User\Modules\LevelController
  • Budabot\User\Modules\LinksController
  • Budabot\User\Modules\LootListsController
  • Budabot\User\Modules\MdbController
  • Budabot\User\Modules\MessageInfoCommandReply
  • Budabot\User\Modules\MockCommandReply
  • Budabot\User\Modules\NanoController
  • Budabot\User\Modules\NewsController
  • Budabot\User\Modules\NotesController
  • Budabot\User\Modules\OnlineController
  • Budabot\User\Modules\OrgHistoryController
  • Budabot\User\Modules\OrglistController
  • Budabot\User\Modules\OrgMembersController
  • Budabot\User\Modules\OSController
  • Budabot\User\Modules\PlayerHistoryController
  • Budabot\User\Modules\PlayfieldController
  • Budabot\User\Modules\PocketbossController
  • Budabot\User\Modules\PremadeImplantController
  • Budabot\User\Modules\PrivateChannelController
  • Budabot\User\Modules\QuoteController
  • Budabot\User\Modules\RaffleController
  • Budabot\User\Modules\RaidController
  • Budabot\User\Modules\RandomController
  • Budabot\User\Modules\RecipeController
  • Budabot\User\Modules\RelayController
  • Budabot\User\Modules\ReputationController
  • Budabot\User\Modules\ResearchController
  • Budabot\User\Modules\RunAsController
  • Budabot\User\Modules\SendTellController
  • Budabot\User\Modules\ShoppingController
  • Budabot\User\Modules\SilenceController
  • Budabot\User\Modules\SkillsController
  • Budabot\User\Modules\SpiritsController
  • Budabot\User\Modules\StopwatchController
  • Budabot\User\Modules\Teamspeak3
  • Budabot\User\Modules\TeamspeakController
  • Budabot\User\Modules\TestController
  • Budabot\User\Modules\TimeController
  • Budabot\User\Modules\TimerController
  • Budabot\User\Modules\TimezoneController
  • Budabot\User\Modules\TowerController
  • Budabot\User\Modules\TrackerController
  • Budabot\User\Modules\TrickleController
  • Budabot\User\Modules\UnixtimeController
  • Budabot\User\Modules\VoteController
  • Budabot\User\Modules\WeatherController
  • Budabot\User\Modules\WhatBuffsController
  • Budabot\User\Modules\WhereisController
  • Budabot\User\Modules\WhoisController
  • Budabot\User\Modules\WhoisOrgController
  • Budabot\User\Modules\WhompahController
  • Command
  • DefaultStatus
  • DefineCommand
  • Description
  • Event
  • HandlesCommand
  • Help
  • Inject
  • Instance
  • Intoptions
  • Matches
  • Options
  • Setting
  • Setup
  • Type
  • Tyrence\Modules\DemoResponseCommandReply
  • Tyrence\Modules\SameChannelResponseController
  • Visibility

Interfaces

  • Budabot\Core\CommandReply

Exceptions

  • Budabot\Core\InvalidHttpRequest
  • Budabot\Core\SQLException
  • Budabot\Core\StopExecutionException

Functions

  • Budabot\Core\isWindows
  • Budabot\Core\Modules\read_input
  • Overview
  • Namespace
  • Class
  1: <?php
  2: 
  3: namespace Budabot\User\Modules;
  4: 
  5: use stdClass;
  6: use DateTime;
  7: 
  8: /**
  9:  * Authors: 
 10:  *  - Tyrence (RK2)
 11:  *
 12:  * @Instance
 13:  *
 14:  * Commands this controller contains:
 15:  *  @DefineCommand(
 16:  *      command     = 'time', 
 17:  *      accessLevel = 'all', 
 18:  *      description = 'Show the time in the different timezones', 
 19:  *      help        = 'time.txt'
 20:  *  )
 21:  */
 22: class TimeController {
 23: 
 24:     /**
 25:      * Name of the module.
 26:      * Set automatically by module loader.
 27:      */
 28:     public $moduleName;
 29:     
 30:     /** @Inject */
 31:     public $util;
 32: 
 33:     /** @Inject */
 34:     public $text;
 35: 
 36:     /**
 37:      * @HandlesCommand("time")
 38:      * @Matches("/^time$/i")
 39:      */
 40:     public function timeListCommand($message, $channel, $sender, $sendto, $args) {
 41:         $link .= "<header2>Australia<end>\n";
 42:         $link .= "<tab><highlight>Western Australia</end>\n";
 43:         $link .= "<tab><tab>Standard Time (AWST = GMT +8:00): " . $this->getTimezone("AWST")->time . "\n";
 44:         $link .= "<tab><highlight>Northern Territory/South Australia<end>\n";
 45:         $link .= "<tab><tab>Standard Time (ACST = GMT+9:30): " . $this->getTimezone("ACST")->time . "\n";
 46:         $link .= "<tab><tab>Summer Time (ACDT = GMT+10:30): " . $this->getTimezone("ACDT")->time . "\n";
 47:         $link .= "<tab><highlight>Queensland/Victoria/Tasmania<end>\n";
 48:         $link .= "<tab><tab>Standard Time (AEST = GMT+10): " . $this->getTimezone("AEST")->time . "\n";
 49:         $link .= "<tab><tab>Summer Time (AEDT = GMT+11): " . $this->getTimezone("AEDT")->time . "\n\n";
 50: 
 51:         $link .= "<header2>Asia<end>\n";
 52:         $link .= "<tab><highlight>Thailand/Vietnam/Kambodscha (ICT = GMT+7)<end>: " . $this->getTimezone("ICT")->time . "\n";
 53:         $link .= "<tab><highlight>China/Malaysia/Singapur/Indonesien (CST = GMT+8)<end>: " . $this->getTimezone("CCST")->time . "\n";
 54:         $link .= "<tab><highlight>Japan/Korea (JST = GMT+9)<end>: " . $this->getTimezone("JST")->time . "\n\n";
 55: 
 56:         $link .= "<header2>Europe<end>\n";
 57:         $link .= "<tab><highlight>England (GMT)<end>: " . $this->getTimezone("GMT")->time . "\n";
 58:         $link .= "<tab><highlight>Germany/France/Netherlands/Italy/Austria<end>\n";
 59:         $link .= "<tab><tab>Standard Time (CET = GMT+1): " . $this->getTimezone("CET")->time . "\n";
 60:         $link .= "<tab><tab>Summer Time (CEST = GMT+2): " . $this->getTimezone("CEST")->time . "\n";
 61:         $link .= "<tab><highlight>Ägypten/Bulgarien/Finnland/Griechenland<end>\n";
 62:         $link .= "<tab><tab>Standard Time (EET = GMT+2): " . $this->getTimezone("EET")->time . "\n";
 63:         $link .= "<tab><tab>Summer Time (EEST/EEDT = GMT+3): " . $this->getTimezone("EEST")->time . "\n";
 64:         $link .= "<tab><highlight>Bahrain/Irak/Russland/Saudi Arabien<end>\n";
 65:         $link .= "<tab><tab>Standard Time (MSK = GMT+3): " . $this->getTimezone("MSK")->time . "\n";
 66:         $link .= "<tab><tab>Summer Time (MSD = GMT+4): " . $this->getTimezone("MSD")->time . "\n\n";
 67:         $link .= "<highlight>Indien (GMT+5:30)<end>: " . $this->getTimezone("IST")->time . "\n\n";
 68:         $link .= "<highlight>Iran (GMT+3:30)<end>: " . $this->getTimezone("IRT")->time . "\n\n";
 69: 
 70:         $link .= "<header2>Canada<end>\n";
 71:         $link .= "<tab>Standard Time (NST = GMT-3:30): " . $this->getTimezone("NST")->time . "\n";
 72:         $link .= "<tab>Summer Time (NDT = GMT-2:30): " . $this->getTimezone("NDT")->time . "\n\n";
 73: 
 74:         $link .= "<header2>USA<end>\n";
 75:         $link .= "<tab><highlight>Florida/Indiana/New York/Maine/New Jersey/Washington D.C.<end>\n";
 76:         $link .= "<tab><tab>Standard Time (EST = GMT-5): " . $this->getTimezone("EST")->time . "\n";
 77:         $link .= "<tab><tab>Summer Time (EDT = GMT-4): " . $this->getTimezone("EDT")->time . "\n";
 78:         $link .= "<tab><highlight>Alaska<end>\n";
 79:         $link .= "<tab><tab>Standard Time (AKST = GMT-9): " . $this->getTimezone("AKST")->time . "\n";
 80:         $link .= "<tab><tab>Summer Time (AKDT = GMT-8): " . $this->getTimezone("AKDT")->time . "\n";
 81:         $link .= "<tab><highlight>California/Nevada/Washington<end>\n";
 82:         $link .= "<tab><tab>Standard Time (PST = GMT-8): " . $this->getTimezone("PST")->time . "\n";
 83:         $link .= "<tab><tab>Summer Time (PDT = GMT-7): " . $this->getTimezone("PDT")->time . "\n";
 84:         $link .= "<tab><highlight>Colorado/Montana/New Mexico/Utah<end>\n";
 85:         $link .= "<tab><tab>Standard Time (MST = GMT-7): " . $this->getTimezone("MST")->time . "\n";
 86:         $link .= "<tab><tab>Summer Time (MDT = GMT-6): " . $this->getTimezone("MDT")->time . "\n";
 87:         $link .= "<tab><highlight>Alabama/Illinois/Iowa/Michigan/Minnesota/Oklahoma<end>\n";
 88:         $link .= "<tab><tab>Standard Time (CST = GMT-6): " . $this->getTimezone("CST")->time . "\n";
 89:         $link .= "<tab><tab>Summer Time (CDT = GMT-5): " . $this->getTimezone("CDT")->time . "\n\n";
 90:         
 91:         $link .= "<header2>Unix time<end>\n";
 92:         $link .= "<tab><tab>" . time() . "\n";
 93: 
 94:         $msg = "<highlight>".$this->util->date(time())."<end>";
 95:         $msg .= " " . $this->text->makeBlob("All Timezones", $link);
 96:         $sendto->reply($msg);
 97:     }
 98:     
 99:     /**
100:      * @HandlesCommand("time")
101:      * @Matches("/^time (.+)$/i")
102:      */
103:     public function timeShowCommand($message, $channel, $sender, $sendto, $args) {
104:         $zone = strtoupper($args[1]);
105:         $timezone = $this->getTimezone($zone);
106:         if ($timezone !== null) {
107:             $msg = $timezone->name." is <highlight>".$timezone->time."<end>";
108:         } else {
109:             $msg = "Unknown timezone.";
110:         }
111: 
112:         $sendto->reply($msg);
113:     }
114:     
115:     public function getTimezone($tz) {
116:         $date = new DateTime();
117:         $time = time() - $date->getOffset();
118:         $time_format = "dS M, H:i";
119: 
120:         switch ($tz) {
121:             case "CST":
122:                 $name = "Central Standard Time (GMT-6)";
123:                 $offset = -(3600*6);
124:                 break;
125:             case "CDT":
126:                 $name = "Central Daylight Time (GMT-5)";
127:                 $offset = -(3600*5);
128:                 break;
129:             case "MST":
130:                 $name = "Mountain Standard Time (GMT-7)";
131:                 $offset = -(3600*7);
132:                 break;
133:             case "MDT":
134:                 $name = "Mountain Daylight Time (GMT-6)";
135:                 $offset = -(3600*6);
136:                 break;
137:             case "PST":
138:                 $name = "Pacific Standard Time (GMT-8)";
139:                 $offset = -(3600*8);
140:                 break;
141:             case "PDT":
142:                 $name = "Pacific Daylight Time (GMT-7)";
143:                 $offset = -(3600*7);
144:                 break;
145:             case "AKST":
146:                 $name = "Alaska Standard Time (GMT-9)";
147:                 $offset = -(3600*9);
148:                 break;
149:             case "AKDT":
150:                 $name = "Alaska Daylight Time (GMT-8)";
151:                 $offset = -(3600*8);
152:                 break;
153:             case "EST":
154:                 $name = "Eastern Standard Time (GMT-5)";
155:                 $offset = -(3600*5);
156:                 break;
157:             case "EDT":
158:                 $name = "Eastern Daylight Time (GMT-4)";
159:                 $offset = -(3600*4);
160:                 break;
161:             case "NST":
162:                 $name = "Newfoundland Standard Time (GMT-3:30)";
163:                 $offset = -(3600*3.5);
164:                 break;
165:             case "NDT":
166:                 $name = "Newfoundland Daylight Time (GMT-2:30)";
167:                 $offset = -(3600*2.5);
168:                 break;
169:             case "UTC":
170:             case "GMT":
171:                 $name = "Greenwich Mean Time (GMT / AO)";
172:                 $offset = 0;
173:                 break;
174:             case "CET":
175:                 $name = "Central European Time (GMT+1)";
176:                 $offset = 3600;
177:                 break;
178:             case "CEST":
179:                 $name = "Central European Summer Time (GMT+2)";
180:                 $offset = 3600*2;
181:                 break;
182:             case "EET":
183:                 $name = "Eastern European Time (GMT+2)";
184:                 $offset = 3600*2;
185:                 break;
186:             case "EEST":
187:                 $name = "Eastern European Summer Time (GMT+3)";
188:                 $offset = 3600*3;
189:                 break;
190:             case "EEDT":
191:                 $name = "Eastern European Daylight Time (GMT+3)";
192:                 $offset = 3600*3;
193:                 break;
194:             case "MSK":
195:                 $name = "Moscow Time (GMT+3)";
196:                 $offset = 3600*3;
197:                 break;
198:             case "MSD":
199:                 $name = "Moscow Daylight Time (GMT+4)";
200:                 $offset = 3600*4;
201:                 break;
202:             case "IRT":
203:                 $name = "Iran Time (GMT+3:30)";
204:                 $offset = 3600*3.5;
205:                 break;
206:             case "IST":
207:                 $name = "Indian Standard Time (GMT+5:30)";
208:                 $offset = 3600*5.5;
209:                 break;
210:             case "ICT":
211:                 $name = "Indochina Time (GMT+7)";
212:                 $offset = 3600*7;
213:                 break;
214:             case "CCST":
215:                 $name = "China Standard Time (GMT+8)";
216:                 $offset = 3600*8;
217:                 break;
218:             case "JST":
219:                 $name = "Japan Standard Time (GMT+9)";
220:                 $offset = 3600*9;
221:                 break;
222:             case "AWST":
223:                 $name = "Australian Western Standard Time (GMT+8)";
224:                 $offset = 3600*8;
225:                 break;
226:             case "ACST":
227:                 $name = "Australian Central Standard Time (GMT+9:30)";
228:                 $offset = 3600*9.5;
229:                 break;
230:             case "ACDT":
231:                 $name = "Australian Central Daylight Time (GMT+10:30)";
232:                 $offset = 3600*10.5;
233:                 break;
234:             case "AEST":
235:                 $name = "Australian Eastern Standard Time (GMT+10)";
236:                 $offset = 3600*10;
237:                 break;
238:             case "AEDT":
239:                 $name = "Australian Eastern Daylight Time (GMT+11)";
240:                 $offset = 3600*11;
241:                 break;
242:             default:
243:                 return null;
244:         }
245: 
246:         $obj = new stdClass;
247:         $obj->name = $name;
248:         $obj->offset = $offset;
249:         $obj->time = date($time_format, $time + $offset);
250:         return $obj;
251:     }
252: }
253: 
Budabot 4 Docs API documentation generated by ApiGen