Esempio n. 1
0
 public function __construct($dateTime = null, $dateTimeZone = 'UTC')
 {
     parent::__construct($dateTime, $dateTimeZone);
     $this->microseconds = $this->value->format('u');
     if ($this->containsFractionalSecondsElement()) {
         // DER requires us to remove trailing zeros
         $this->microseconds = preg_replace('/([1-9]+)0+$/', '$1', $this->microseconds);
     }
 }
Esempio n. 2
0
 public function __construct(Identifier $identifier, ContentLength $contentLength, Content $content, array $children = [])
 {
     parent::__construct($identifier, $contentLength, $content, $children);
     if (!$this->identifier->isConstructed) {
         $this->setValue($content);
     }
     $this->microseconds = $this->value->format('u');
     if ($this->containsFractionalSecondsElement()) {
         // DER requires us to remove trailing zeros
         $this->microseconds = preg_replace('/([1-9]+)0+$/', '$1', $this->microseconds);
     }
 }