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.
我需要选择该月的所有 4 周。我是如何获得工作日的:
SELECT impression_ip, WEEKDAY(FROM_UNIXTIME(impression_time)) FROM impressions WHERE impression_time BETWEEN start_timestamp AND end_timestamp
idk mysql 函数,但如果你得到我,它应该类似于 MONTHWEEK
PHP 片段在这里
可以在执行 SQL 语句之前实施解决方案。
鉴于今天的日期 -2012-05-09
2012-05-09
$currentDate = date("Y-m-d");// Take the current date //Add four weeks $plusFourWeeks = strtotime($currentDate . " +4 weeks "); echo $plusFourWeeks;
日期 增加四个星期后:2012-06-06
2012-06-06
为了您的方便—— 或者如果您只是不信任我;)