【发布时间】:2020-03-23 03:21:21
【问题描述】:
Windows 10 64 位。 PHP 7.4.1
您最喜欢的网页是否返回带有围绕时间戳构建的 URL 的数据?这个问题试图用 PHP date() 复制这些 URL。
对我来说,最困难的部分是起点:
从分钟开始向下舍入到最接近的 10(19 变为 10)年、月、日、小时、分钟和秒总是 00 每 10 分钟持续 120 分钟?时间戳有两种格式:
032320200030 and 202003230030
mdYHi and YmdHi
我喜欢strtotime。
date('mdYHi', strtotime("+10 minutes"));
date('YmdHi', strtotime("+10 minutes"));
但我无法将起点融入其中。
(floor(date("i") / 10) * 10)
从分钟开始向下舍入到最接近的 10(19 变为 10)。
【问题讨论】:
标签: php windows-10