Convert Javascript Date object to Excel serial number

So I have a Javascript date object with year, month, days, hours, minutes, seconds, and milliseconds data and I need to convert this object to an Excel serial number but I didn’t find a way to do that.
I found how to convert only a Date object but the way I found didn’t consider the time part.

Any suggestions?
Thank you,
Regards.