PHP date format /Date(1365004652303-0500)/

后端 未结 10 1106
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 05:56

I am calling an API from where I am getting date /Date(1365004652303-0500)/, I don\'t understand what format this is. How is this date format called? I was not

10条回答
  •  迷失自我
    2020-11-27 06:42

    Let's break /Date(1365004652303-0500)/ down to:

    • Date
    • 1365004652303
    • -0500

    First string makes itself pretty clear.

    The next large number is the epoch value

    The -0500 represents the timezone in which the dates were originally stored. It is relative to UTC and thus, it is referring to Eastern Standard Time.


    EDIT

    The epoch is with a milisecond precision. Try this code:

    
    

    You can also use the timezone for setting the date relative to your own. http://codepad.viper-7.com/RrSkMy

提交回复
热议问题