dtjwov4984 2015-03-17 07:21
浏览 71
已采纳

什么是这个奇怪的日期值的时间格式

I'm working with an xml file in php and my concern is on the date field. The xml outputs the date likes this ..

<EndTime>1427295540000</EndTime>

I'm having a hard time identifying the format of this time, and how to convert it to something like 2015-05-11 12:00:00. Please help

  • 写回答

2条回答 默认 最新

  • dongzhan0624 2015-03-17 07:26
    关注
    $input = 1427295540000 / 1000; //because we wants seconds but got miliseconds then divide by 1000
    echo date("Y-m-d H:i:s", $input);
    

    you can divide value of end time by 1000, because we wants seconds in php and then pass it as second argument to date function with proper format as frist argument

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了