S
S
Svet Valentin2019-02-09 11:45:01
PHP
Svet Valentin, 2019-02-09 11:45:01

How to format the date correctly?

Through the web service API I get:
["DateTime"]=> Date(1550959199000) [
"OffsetMinutes"]=>120

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
wagoodoogoo, 2019-02-09
@walyk

this is in milliseconds, you need to divide by 1000 to get seconds if you need to take into account the offset, then add / subtract ["OffsetMinutes"] (considering that these are minutes)

A
Anton Shamanov, 2019-02-09
@SilenceOfWinter

date('...', substr($date['DateTime'], 5, -1) / 1000)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question