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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Note the
PHP 5 >= 5.3.0on the doc page. I can only assume you’re using a version pre-5.3, therefore: