Reputation: 2193
How can I get the Timestamp from a luxon dateTime object?
For example?
const { DateTime } = require("luxon");
date = DateTime.now().setZone('utc');
date.endOf('day);
console.log(date.???) // should give something like 1629399474922
This should be the equivalent to javascript's Date.getTime()
function.
Upvotes: 19
Views: 18166
Reputation: 2193
The Luxon docs are surprisingly silent on this, but after some digging I finally found it:
date.toMillis();
// or
date.valueOf();
Upvotes: 31