生成最近2周的日期范围? [英] Generate a date range of the latest 2 weeks?

查看:56
本文介绍了生成最近2周的日期范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想生成2个DATETIME,代表从星期日到星期几2x的最新的2周,不应包括当前不完整的周。

I want to generate 2 DATETIME which represent the latest 2 weeks starting from sunday to saturday 2x, It shouldn't include the current incomplete week.

欣赏您的帮助

推荐答案

开始的东西:

$timestamp_end = strtotime("last Saturday");
$timestamp_start = $timestamp_end - 14 * 24 * 3600;

这篇关于生成最近2周的日期范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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