PHP Gets the current date and formatting, PHP gets the current date
Date (' y-m-d h:i:s ', Time ());
How PHP Gets the current time
To set the time zone, PHP defaults to not China's time zone, which is GMT. So set the time zone can be done! date_default_timezone_set (' etc/gmt-8 ');//The time zone is set here
echo Date ("y-m-d h:i:s");
?>
Ask the timestamp of the current date in PHP (year-month-day) how to write?
It would be nice to format it with the DATE function!
echo Date ("Y-m-d", Time ());
Formatting string description See picture ~
I hope my answer is helpful to you! hehe ~
http://www.bkjia.com/PHPjc/867007.html www.bkjia.com true http://www.bkjia.com/PHPjc/867007.html techarticle PHP Gets the current date and formatting, PHP gets the current date (' y-m-d h:i:s ', Time ()); PHP How to get the current time to set the time zone, PHP default is not China's time zone, is Greenwich ...