Developers Documentation

×

Warning

301 error for file:https://clearos.com/dokuwiki2/lib/exe/css.php?t=dokuwiki&tseed=82873f9c9a1f5784b951644363f20ef8

User Tools

Site Tools


Time Class Source Code

To give you a feel for the code in the ClearOS API, here is a sampling of the Time class – the Time.GetTimeZoneList() method is shown below.

class Time extends Engine {

  ... snip ...
  
  /**
   * Returns a list of available time zones on the system.
   * 
   * @return array a list of available time zones
   * @throws EngineException
   */
  public function GetTimeZoneList()
  {
      if (COMMON_DEBUG_MODE)
          $this->Log(COMMON_DEBUG, "called", __METHOD__, __LINE__);
      $zonelist = array();
      $zoneinfo = array();
      foreach (explode(" ", self::PATH_ZONEINFO_SUBDIR) as $subzone) {
          try {
              $folder = new Folder(self::PATH_ZONEINFO . "/" . $subzone);
              $subzones = $folder->GetListing();
          } catch (Exception $e) {
              throw new EngineException($e->GetMessage(), COMMON_ERROR);
          }
          foreach ($subzones as $zone) {
              $md5 = md5_file(self::PATH_ZONEINFO . "/$subzone/$zone");
              $zoneinfo["fullzone"] = "$subzone/$zone";
              $zoneinfo["subzone"] = $subzone;
              $zoneinfo["zone"] = $zone;
              $zoneinfo["md5"] = $md5;
              $zonelist[] = $zoneinfo;
          }
      }
      return $zonelist;
  }
  ... snip ...

}

content/en_us/dev_framework_time_class_source_code.txt · Last modified: 2014/12/23 15:10 by dloper

https://clearos.com/dokuwiki2/lib/exe/indexer.php?id=content%3Aen_us%3Adev_framework_time_class_source_code&1710833620