Need help with converting a unix date

I am working with a payments API that returns a 13 digit unix date, i.e. 1601337615995l, into one of my backend API’s. This causes bubble to record the date incorrectly when I try to store it into my database.

I know that in theory I could divide this by 1000 to get the correct date, but I am having difficulty saving this. When I configure the data types in my API, if I set it as a date, I cant perform a mathematical operation on it before saving it into my database. If I set the datatype as a number I can do the math, but I cant save it as a date (unix).

Has anyone solved any similar issues?

The date is set as UTC but in your editor it will show the date as it is in your timezone

The date still sets as really far into the future.

Screenshot 2024-12-02 094935