0

i have problem converting timestamp in millisecond . i have to take data from an api by timestamp below is original time stamp from api site

     API timestamp 1520683685974 (30 days back from current time )

    if you look 1520683685 this is real timestamp 

    the last 3 digit 974 i don't know how it come 

i am trying the following to get timestamp but could not get last 3 digit extra

      $currentDate =  time();
      $date = strtotime(date("Y-m-d H:i:s", $currentDate)."-30 day ");
      output= 1520682524

the last digit 3 digit i don't know how to get . can any body know about the last 3 digit

you can the convert the original time stamp on following link to understand the last 3 digit may be some one know

https://www.epochconverter.com/

david
  • 5
  • 2
  • 8
  • Well, just multiply by 1000. There is also now reason to call date first. `strtotime("30 days ago");` works just fine – Peter Apr 09 '18 at 12:01
  • @Peter yes i did with 1000 but did not get the result from api seem my timestamp was wrong – david Apr 09 '18 at 12:10

0 Answers0