我将如何改变“注册”日期在 MySQL 表中的显示方式?我希望以这种方式格式化日期:2013 年 8 月 26 日星期一下午 6:04,而不是基于 24 小时制的通常标准格式。
目前我有:
$value = mysql_real_escape_string($_POST['First']);
$value2 = mysql_real_escape_string($_POST['Last']);
$value3 = mysql_real_escape_string($_POST['City']);
$value4 = mysql_real_escape_string($_POST['State']);
$value5 = mysql_real_escape_string($_POST['Country']);
$value6 = mysql_real_escape_string($_POST['Email']);
SQL:
$sql = "
INSERT INTO members
(First, Last, City, State, Country, Email, Date)
VALUES
('$value', '$value2', '$value3', '$value4', '$value5', '$value6', NOW())
";
我认为更改格式就像这样简单:
$sql = "
INSERT INTO members
(First, Last, City, State, Country, Email, Date)
VALUES
('$value','$value2','$value3','$value4','$value5','$value6' ("l-F-j-Y))
";