Luxon: Create DateTime from timestamp?

Created on 12 Jan 2018  路  1Comment  路  Source: moment/luxon

I looked through the documentation but I don't think I've found an option to simply create a DateTime object from a numerical timestamp, the representation that DateTime uses internally. I am using a Web Worker which passes messages to the main thread that include DateTimes, but the DateTime 'type' of the object is stripped when it's passed back to the main thread, so it lacks the prototype methods.

Of course, I can probably work around by converting DateTimes to a more serializable format when passing the data back, but I do still wonder if not having the option to create a date from a timestamp is intentional or oversight.

Most helpful comment

Never mind, I simply had to search better, it is fromMillis.

>All comments

Never mind, I simply had to search better, it is fromMillis.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peterjanes picture peterjanes  路  5Comments

jonathanborges picture jonathanborges  路  6Comments

kwtucker picture kwtucker  路  6Comments

UnsungHero97 picture UnsungHero97  路  5Comments

kaftand picture kaftand  路  4Comments