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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -