下个月的最后一天日期时间戳在PHP? [英] Last day of next month date timestamp in PHP?

查看:41
本文介绍了下个月的最后一天日期时间戳在PHP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下函数来获取当前时间戳:

I'm using the following function to get the current timestamp:

$created_timestamp = date("Y-m-d H:i:s");

但是我如何获得下个月最后一天的时间戳.例如,如果是9月15日到10月31日.包括所有的小时,分​​钟和秒吗?

But how do I get a timestamp for the last day of next month. So for example, if it is the 15th of September to get the 31st of October. Including all the hours, minutes and seconds as well?

推荐答案

$created_timestamp = date("Y-m-t  H:i:s", strtotime("+1 month"));

t -给定月份的天数

这篇关于下个月的最后一天日期时间戳在PHP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆