PHP gets the current date and formats it, php gets the current date
date('Y-m-d H:i:s',time());
To set the time zone, PHP's default time zone is not China's time zone, but Greenwich Mean Time. So just set the time zone and you’re done! eb7d796cb198a9ebe90c4bbf04803752
Just use the date function to format it!
echo date("Y-m-d",time());
See the picture for format string description~
I hope my answer will be helpful to you! Haha~
http://www.bkjia.com/PHPjc/867007.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/867007.htmlTechArticlePHP gets the current date and formatting, php gets the current date date('Y-m-d H:i:s',time ()); How to get the current time in PHP requires setting the time zone. The default PHP time zone is not China’s time zone, but Greenwich Mean Time...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn