public createDateTime ( integer $timestamp = null ) : DateTime | ||
$timestamp | integer | |
return | DateTime |
public function createDateTime($timestamp = null)
{
$dateTime = new \DateTime();
if ($timestamp !== null) {
$dateTime->setTimestamp($timestamp);
}
return $dateTime;
}