sách gpt4 ai đã đi

php - SQL 中 strtotime 相当于什么?

In lại 作者:行者123 更新时间:2023-11-29 07:07:04 28 4
mua khóa gpt4 Nike

我的第一个表格中有一个采用这种格式的日期 2016-12-20我需要将其与第二个表中采用这种格式的另一个日期进行比较

 2016-12-21 18:40:22

在 php 中,我可以使用

更改此格式

$date = date("Y-m-d", strtotime($date));

SQLTRONGthời gian相当于什么,或者我如何比较mysql中不同格式的2个日期?

我读了 this question 并尝试了这个

select STR_TO_DATE(date, '%y-%m-%d') from second_table;

但它返回 NULL

1 Câu trả lời

Date and Time Functions

您可能需要使用date_format()

关于php - SQL 中 strtotime 相当于什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41269179/

28 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com