I have a field in ms from epoch, like 1350393140000. I need to, in PhP, get this field as a datetime, change the time portion of it to 7AM (UTC time) and convert it back to ms from epoch. How can I do this?
2条回答 默认 最新
- dsqtl335227 2012-10-16 13:16关注
$input = 1350393140000; $dt = new DateTime('@' . floor($input / 1000)); $dt->setTimeZone(new DateTimeZone('UTC')); $dt->modify('07:00'); $output = $dt->format('U') * 1000;
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥50 winform中使用edge的Kiosk模式
- ¥15 关于#python#的问题:功能监听网页
- ¥50 comsol稳态求解器 找不到解,奇异矩阵有1个空方程返回的解不收敛。没有返回所有参数步长;pid控制
- ¥15 怎么让wx群机器人发送音乐
- ¥15 fesafe材料库问题
- ¥35 beats蓝牙耳机怎么查看日志
- ¥15 Fluent齿轮搅油
- ¥15 八爪鱼爬数据为什么自己停了
- ¥15 交替优化波束形成和ris反射角使保密速率最大化
- ¥15 树莓派与pix飞控通信