当前位置:网站首页>How to get the first and last days of a given month

How to get the first and last days of a given month

2022-07-08 01:19:00 Superior virtue and weak water

problem :

I wish to rewrite a mysql query which use month() and year() functions to display all the posts from a certain month which goes to my function as a 'Ymd' parameter format, but I don't know how can I get the last day of the given month date. I want to rewrite one mysql Inquire about , It USES month() and year() Function to display all posts in a month , These posts serve as 'Ymd' Parameter format goes to my function , But I don't know how to get the last day of a given month .

$query_date = '2010-02-04';list($y, $m, $d) = explode('-', $query_date);$first_day = $y . '-' . $m . '-01';

Solution :

Reference resources : https://stackoom.com/en/question/Ve0A
原网站

版权声明
本文为[Superior virtue and weak water]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130545095267.html