gpt4 book ai didi

php - 如何转换 yyyy mm dd h :m:s to dd mm yyyy h:m:s?

转载 作者:太空宇宙 更新时间:2023-11-04 14:02:55 25 4
gpt4 key购买 nike

<分区>

            In mysql data base the date is f=stored in the format of now() function like yyyy mm dd hh mm ss. But in frontend tool i want it like dd mm yyyy hh mm ss how can i convert it.


<?php
$addqry=mysql_query("INSERT INTO `exam` (`user_id`,`sub_id`,`q_id`,`stud_ans`,`date_time`)VALUES ('$user', '$sub', '$ans', '$stud_ans',(Now()))");
$stud_ans=' ';
if($addqry)
{
//result
$date;
$last_date=mysql_query("SELECT date_time FROM exam ORDER BY id DESC LIMIT 1; ");
while($res_last=mysql_fetch_array($last_date))
{
$date=$res_last['date_time'];
}
?>

这里它以 2014-04-12 15:34:40 的格式给出日期时间,但我希望它像 12-04-2014 15:34:40

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com