phpactiverecord retrieves it and stores it in an object that extends DateTime
.
Normally you could do ->format($yourformat)
for any DateTime
object, but for the phpactiverecord
child you get a default format that gets used if you do not supply one.
This extension also has a toString()
function that calls this format()
, so you get the default format (which you can set in this same class by the way).
Take a look at the DateTime.php
class provided by PHPActiveRecord to find out more, but this is what happens:
class DateTime extends \DateTime{
public static $DEFAULT_FORMAT = 'rfc2822';
//array with formats here
public function format($format=null){
return parent::format(self::get_format($format));
}
public static function get_format($format=null){
//get default format if nothing is provided
}
public function __toString(){
//gets called when you use the object as a string
return $this->format();
}
}