easy-swoole / easyswoole

swoole,easyswoole,swoole framework
https://www.easyswoole.com/
Apache License 2.0
4.74k stars 510 forks source link

Time获取日 开始时间戳 和 结束时间戳 要少一天 #511

Closed dalangll closed 2 years ago

dalangll commented 3 years ago

当参数为日期格式返回时间戳少一天

use EasySwoole\Utility\Time;
$start = Time::startTimestamp('2021-10-05');
$end = Time::endTimestamp('2021-10-05');

$st_date = date("y-m-d H:i:s",$start);
$en_date = date("y-m-d H:i:s",$end);

return $this->writeJson(200,'success',[$start,$end,$st_date,$en_date]);

image

chris1678 commented 3 years ago

怀疑你的时间区没设置

dalangll commented 3 years ago

EasySwooleEvent文件 有设置 date_default_timezone_set('Asia/Shanghai');的

在 2021-11-15 16:37:11,"shoushouxiongying" @.***> 写道:

怀疑你的时间区没设置

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

XueSiLf commented 2 years ago

已修复,详见 https://github.com/easy-swoole/utility/pull/13

dalangll commented 2 years ago

已修复