setDateTimeFormat() public method

Setter to adjust the date/time format output of ___CREATED___
public setDateTimeFormat ( string $frmt )
$frmt string Date/Time format string
Example #1
0
 /**
  * Helper to get instance of AutoloadRenderer with cli options applied
  *
  * @param CollectorResult $result
  *
  * @throws \RuntimeException
  * @return \TheSeer\Autoload\AutoloadRenderer|\TheSeer\Autoload\StaticRenderer
  */
 public function getRenderer(CollectorResult $result)
 {
     $isStatic = $this->config->isStaticMode();
     $isPhar = $this->config->isPharMode();
     $isCompat = $this->config->isCompatMode();
     $isOnce = $this->config->isOnceMode();
     if ($isStatic === TRUE) {
         $renderer = new StaticRenderer($result->getUnits());
         $renderer->setDependencies($result->getDependencies());
         $renderer->setPharMode($isPhar);
         $renderer->setRequireOnce($isOnce);
     } else {
         $renderer = new AutoloadRenderer($result->getUnits());
         if ($this->config->usePrepend()) {
             $renderer->prependAutoloader();
         }
         if ($this->config->useExceptions()) {
             $renderer->enableExceptions();
         }
     }
     $renderer->setCompat($isCompat);
     $basedir = $this->config->getBaseDirectory();
     if (!$basedir || !is_dir($basedir)) {
         throw new \RuntimeException("Given basedir '{$basedir}' does not exist or is not a directory");
     }
     $renderer->setBaseDir($basedir);
     $format = $this->config->getDateFormat();
     if ($format) {
         $renderer->setDateTimeFormat($format);
     }
     $renderer->setIndent($this->config->getIndent());
     $renderer->setLineBreak($this->config->getLinebreak());
     foreach ($this->config->getVariables() as $name => $value) {
         $renderer->setVariable($name, $value);
     }
     return $renderer;
 }
 /**
  *
  * @depends testSettingTimestamp
  */
 public function testSettingDateTimeFormat()
 {
     $ab = new \TheSeer\Autoload\AutoloadRenderer($this->classlist);
     $now = time();
     $ab->setTimestamp($now);
     $ab->setDateTimeFormat('dmYHis');
     $this->assertEquals(date('dmYHis', $now), $ab->render('___CREATED___'));
 }