Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
基本上我需要做的是将时间 00:01 添加到用户选择的任何日期以查找日期/时间之间的结果,有人可以帮我吗?
您可以在这样的日期获得 00:01 的时间戳:
$timestamp = strtotime($date_from_user . ' 00:01');
然后,您可以根据需要使用 格式化该时间戳date(),尽管您可能不需要这样做。
date()
SELECT * FROM table WHERE datecol BETWEEN '$date1' AND '$date2'