openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

DslDate.class.php (1487B)


      1 <?php
      2 
      3 namespace cms\generator\dsl;
      4 
      5 use cms\model\Page;
      6 use cms\model\Project;
      7 use dsl\context\DslObject;
      8 
      9 class DslDate implements DslObject
     10 {
     11 	private $time;
     12 
     13 	/**
     14 	 * DslPage constructor.
     15 	 */
     16 	public function __construct($time=null)
     17 	{
     18 		if   ( $time = null )
     19 			$time = time();
     20 
     21 		$this->time = $time;
     22 	}
     23 
     24 
     25 	public function getDate() { return date('d',$this->time); }
     26 	public function getDay() { return date('w',$this->time); }
     27 	public function getFullYear() { return date('Y',$this->time); }
     28 	public function getHours() { return date('H',$this->time); }
     29 	public function getMilliseconds() { return 0; }
     30 	public function getMinutes() { return date('i',$this->time); }
     31 	public function getMonth() { return date('m',$this->time); }
     32 	public function getSeconds() { return date('s',$this->time); }
     33 	public function getTime() { return $this->time * 1000; }
     34 	public function getTimezoneOffset() {return date('y',$this->time)/60;}
     35 	public function getUTCDate() {return date('d',$this->time);}
     36 	public function getUTCDay() {return date('w',$this->time);}
     37 	public function getUTCFullYear() {return date('Y',$this->time);}
     38 	public function getUTCHours() {return date('H',$this->time);}
     39 	public function getUTCMilliseconds() {return 0;}
     40 	public function getUTCMinutes() {return date('i',$this->time);}
     41 	public function getUTCMonth() {return date('m',$this->time);}
     42 	public function getUTCSeconds() {return date('s',$this->time);}
     43 	public function getYear() { return date('y',$this->time); }
     44 }