I am trying to get the timestamp in php. Using following code
$date = new DateTime();
echo $date->getTimestamp();
error comes getTimestamp() is undefined
however according to this
I need the format like 123456789
I am trying to get the timestamp in php. Using following code
$date = new DateTime();
echo $date->getTimestamp();
error comes getTimestamp() is undefined
however according to this
I need the format like 123456789
Note the PHP 5 >= 5.3.0
on the doc page. I can only assume you're using a version pre-5.3, therefore:
echo time(); //output: 1358796864