As explained by Ricky Mo you must specify the timezone value of your date,
otherwise the system will use the host system's timezone at this date (with STD or DST calculation).
2 ways
var s = "2023-06-19T05:00:00.554+00:00"
// or
var s = "2023-06-19T05:00:00.554Z" // Zulu time zone
thanks to Darryl Noakes for reminding me Z
(stand for "Zulu" from the ICAO) (but I remember more easily the notation with the positive +
or negative -
sign with the value of the time difference in ±hh:mm
)
var s = "2023-06-19T05:00:00.554+00:00"; // GMT 0 -> + 0h, 0mn
var epoch = new Date(s).getTime();
console.log(epoch); // 1687150800554 everywhere in the world!