如何查询指定月份的最后一天是哪一天?

更新于
2026-09-24 18:56:35
1阅读来源:SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计50个文字,预计阅读时间需要1分钟。

如何查询指定月份的最后一天是哪一天?

pythondef get_the_month(date): first_day=date('Y-m-01', date) last_day=date('Y-m-d', strtotime(first_day + ' 1 month -1 day')) return last_day

gistfile1.txt

function getthemonth ($date) { $firstday = date('Y-m-01', $date); $lastday = date('Y-m-d', strtotime("$firstday +1 month -1 day")); return $lastday; }

如何查询指定月份的最后一天是哪一天?