PHP 中的 NOW() 函数 [英] NOW() function in PHP
本文介绍了PHP 中的 NOW() 函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有 PHP 函数以与 MySQL 函数 NOW()
相同的格式返回日期和时间?
Is there a PHP function that returns the date and time in the same format as the MySQL function NOW()
?
我知道如何使用 date()
来实现,但我想知道是否有专门用于此的函数.
I know how to do it using date()
, but I am asking if there is a function only for this.
例如返回:
2009-12-01 00:00:00
推荐答案
您可以使用 日期 函数:
date("Y-m-d H:i:s");
这篇关于PHP 中的 NOW() 函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文