You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where the second argument is correctly providing my timezone.
What am I expecting here: "Given a date and any time zone, returns a Date with the equivalent UTC time." I am expecting to see a Date object with a value that represents my current time (for example "14:47") in UTC, I would effectively see an offset of 3 hours as the result. Instead I'm getting back: the exact same timestamp.
However. When I run:
zonedTimeToUtc(new Date())
The result is what I would expect above.
The fact that this function works without a second argument is not documented in the readme or anywhere else I could find.
The text was updated successfully, but these errors were encountered:
Similar to your initial code I had been extracting the timezone of the date fed into it thinking why it was necessary in the first place.
Ironically the function is typed to require this second value as well, I'm passing null as a second parameter just so TS isn't complaining which really doesn't make sense.
I am in UTC + 3. I am running the following code:
Where the second argument is correctly providing my timezone.
What am I expecting here: "Given a date and any time zone, returns a Date with the equivalent UTC time." I am expecting to see a Date object with a value that represents my current time (for example "14:47") in UTC, I would effectively see an offset of 3 hours as the result. Instead I'm getting back: the exact same timestamp.
However. When I run:
The result is what I would expect above.
The fact that this function works without a second argument is not documented in the readme or anywhere else I could find.
The text was updated successfully, but these errors were encountered: