I am using moment.js to format time, but after formating, the output will result as a string, I need the variable as a DateTime since I am using that variable to insert in the database, and insertion cannot be done successfully since the now variable is a string.
import moment from "moment";
import "moment-timezone";
let now = moment().tz("Europe/Berlin").format("YYYY-MM-DD HH:mm:ss");
console.log(typeof now); // STRING