Quantcast
Channel: Active questions tagged mongodb-atlas - Stack Overflow
Viewing all articles
Browse latest Browse all 271

Luxon - Invalid DateTime when using setZone on Mongo Atlas trigger

$
0
0

I've been struggling for some time to get setZone to work using the luxon library on a Mongo Atlas trigger. It's been a real nightmare. I have downgraded and upgraded versions of luxon in Atlas without any success. Currently, I'm using version 2.0.1 because the latest version of luxon has issues with Intl in Atlas. Any help would be appreciated.

const { DateTime } = require('luxon');exports = async function() { const dt = DateTime.now(); // dt returns eg) 2024-11-25T14:01:55.223+00:00 const dtInNewYork = dt.setZone('America/New_York'); // here is the issue console.log(dtInNewYork.toString()); // Invalid DateTime};

Viewing all articles
Browse latest Browse all 271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>