作者热门文章
- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
在我的 PHP 代码中,我的变量“$postedDate”中有一个日期。
现在我想获取 7 天、15 天、1 个月和 2 个月后的日期。
我应该使用哪个日期函数?
输出日期格式应为美国格式。
最佳答案
使用 strtotime。
$newDate = strtotime('+15 days',$date)
$newDate 现在将在 $date 之后 15 天。 $date 是 unix 时间。
关于php - 如何在 PHP 中获得 15 天/1 个月后的日期?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/828332/
我是一名优秀的程序员,十分优秀!