FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Time.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Rsi\Fred\DateTime;
4 
5 class Time extends DateTime{
6 
7  public static function create($value,$format = null){
8  if(!is_numeric($value)) return parent::create(substr($value,0,8),$format ?: 'H:i:s');
9  $result = new static();
10  $result->setTime(0,0,$value);
11  return $result;
12  }
13 
14  public function __toString(){
15  return $this->format('U');
16  }
17 
18 }
static create($value, $format=null)
Definition: Time.php:7