Creating DateTime from timestamp in PHP < 5.3 -
how create datetime timestamp in versions less < 5.3?
in 5.3 be:
$date = datetime::createfromformat('u', $timestamp);
the datetime constructor wants string, didn't work me
$date = new datetime("@$timestamp");
php 5 >= 5.2.0
$date = new datetime(); $date->settimestamp($timestamp);
Comments
Post a Comment