Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140071

how to import an UTC timestamp to Luxon as it is? (Migrating from Moment)

$
0
0

I have this line in my app:

const createdOn: moment.Moment = moment.utc(created_on)

This basically imports created_on as an UTC timezone. created_on is also UTC. So, this method does not break the timezone and import UTC properly. Also I have this one:

That generates current timestamp in UTC timezone.

moment.utc()

Note that, If I just import date to moment and then convert it to UTC, my time goes wrong. Moment by default assumes given date is equal to current visitors timezone. I need to import time as it is. Which is UTC all the time.

What is the equivelant on Luxon?


Viewing all articles
Browse latest Browse all 140071

Trending Articles



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