skip to Main Content

javascript converting datestring to epoch returns three digits too much

I am converting a string to epoch like this: arrival = $('#aircraft_arrival_time').val(); console.log(arrival); //2023-12-09T14:03 temp = arrival.split("T"); arrivalDatePart = temp[0]; arrivalDate = arrivalDatePart + "T00:00:00.000Z"; console.log(arrivalDate); //2023-12-09T00:00:00.000Z chartFrom = Date.parse(arrivalDate); //beginning of that day, UTC console.log(chartFrom); //1702080000000 var f =…

VIEW QUESTION

Php – Converting Epoch to EST, off by an hour?

I'm trying to convert an epoch into a human friendly date-time. I'm off by 1 hour. Why? $aptTime = 1694194200; if(!empty($aptTime)) { $aptDisplay = new dateTime("@$aptTime"); $aptDisplay->setTimezone(new DateTimeZone('EST')); $aptStr = date_format($aptDisplay, "l F jS a\t g:i A"); $html = '<p…

VIEW QUESTION
Back To Top
Search