gpt4 book ai didi

mysql - Codeigniter:从 DateTime Mysql 获取日期

转载 作者:行者123 更新时间:2023-11-29 07:40:49 26 4
gpt4 key购买 nike

查询Codeigniter:

$bookvisit = $this->db->query("SELECT 
(
SELECT
name
FROM
tbl_user as u
WHERE
u.user_id=b.user_id
) as BookVisitFrom,
b.status as status,
b.booktime as booktime,
b.bookdate as bookdate,
--> b.created as created,
b.is_confrim as is_confrim,
b.id as id
FROM
tbl_bookvisit as b
");

我只想要“创建”(其列名称)中的日期时间中的日期,我怎样才能得到它!!

最佳答案

您可以使用date函数来实现

date(b.created)  as created

mysql> select date('2015-01-01 20:30:40') as only_date ;
+------------+
| only_date |
+------------+
| 2015-01-01 |
+------------+
1 row in set (0.00 sec)

关于mysql - Codeigniter:从 DateTime Mysql 获取日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29116506/

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