Esempio n. 1
0
 function __construct(READER $reader = NULL, $opts = false)
 {
     parent::__construct($reader);
     $correction = 0;
     $offset = 0;
     $tps = 1;
     if ($opts) {
         if (is_int($opts['correction'])) {
             $correction = $opts['correction'];
         }
         if (is_int($opts['offset'])) {
             $offset = $opts['offset'];
         }
         if (is_int($opts['ticks_per_second'])) {
             $tps = $opts['ticks_per_second'];
         }
     }
     $this->offset = $offset - $correction;
     $this->mult = $tps;
     if ($tps > 1) {
         $this->subsec_digits = strlen($tps) - 1;
         if ("{$tps}" != "1" . str_repeat('0', $this->subsec_digits)) {
             $this->subsec_digits = false;
         }
     } else {
         $this->subsec_digits = false;
     }
 }
Esempio n. 2
0
 function __construct(READER $reader = NULL, $correction = 0)
 {
     parent::__construct($reader);
     if (is_int($correction)) {
         $this->correction = $correction;
     } else {
         $this->correction = 0;
     }
 }
Esempio n. 3
0
 public function __construct(READER $reader = NULL, $opts = false)
 {
     parent::__construct($reader, $opts);
     $this->time_format = $opts['format'];
     $this->time_zone = $opts['timezone'];
 }