JS Date object has some methods to parse, and convert Dates.
That said, working with time is always a pain in my professional opinion, there are always different factors to account in, for example the user’s local time may produce a different date.
There are libraries which aims to help reduce the workloads in this aspects,
I think the most popular / spread in JS is still