| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- class mytimeInit{
- private $year;
- private $mouth;
- private $date;
- private $hour;
- private $minute;
- private $microtime;
- private $logtime;
- private $Time;
- public function __construct($read_time = null) {
- if($read_time){
- $strtime=strtotime($read_time);
- $to_time=$strtime-600;
- }else{
- $log_time=time()-300;
- $this->explode_time($log_time);
- $this->set_logtime();
- $to_time=time()-900;
- }
- $this->explode_time($to_time);
- }
- public function explode_time($to_time){
- $this->Time=date("Y-m-d-H-i",$to_time);
- $to_time_array=explode("-", $this->Time);
- $this->year=$to_time_array[0];
- $this->mouth=$to_time_array[1];
- $this->date=$to_time_array[2];
- $this->hour=$to_time_array[3];
- $this->minute=$to_time_array[4];
- $this->minute=$this->minute{0}.'0';
- $this->microtime=mktime(0, 0, 0, $this->mouth, $this->date,$this->year);
- }
- public function get_microtime(){
- return $this->microtime;
- }
- public function get_Time(){
- return $this->Time;
- }
- public function set_logtime(){
- $this->logtime=$this->year.$this->mouth.$this->date.$this->hour.$this->minute;
- }
- public function get_logtime(){
- return $this->logtime;
- }
- public function get_tablename(){
- $tablename=$this->year.$this->mouth;
- return $tablename;
- }
- public function get_thedate(){
- $Thedate =$this->year.'-'.$this->mouth.'-'.$this->date;
- return $Thedate;
- }
- public function get_thehours(){
- return $this->hour;
- }
- public function get_date(){
- return $this->date;
- }
- public function get_minute(){
- return $this->minute;
- }
- }
- ?>
|