M
M
Master Ruby2021-08-22 15:51:38
Python
Master Ruby, 2021-08-22 15:51:38

How to convert JSON data to date?

At the output of the request to JSON, I get:
'scheduledStart': 1629637200000

How to convert this value - 1629637200000 to date and time ?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-08-22
@Dunaevlad

It's called a timestamp (unix time), so

from datetime import datetime

timestamp = 1629637200000
date = datetime.fromtimestamp(timestamp/1000)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question