Created
October 17, 2015 16:29
-
-
Save michalsen/30a668f68d1a7c465679 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create Time Object | |
*/ | |
class getTime { | |
public $time = ""; | |
/** | |
* Set Time in Object | |
*/ | |
function __construct() { | |
$this->time = $this->getTimeNow(); | |
} | |
/** | |
* Get Time | |
*/ | |
public function getTimeNow() { | |
$time = time('U'); | |
return $time; | |
} | |
} | |
$timeObj = new getTime(); | |
print_r($timeObj->time); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment