skip to Main Content

Javascript – Date Milliseconds same for two dates

I have a date string of format 'dd-mm-yyyy' which I want to convert to Milliseconds. let split_date = '31-01-2024'.split('-'); let d = new Date(parseInt(split_date[2]), parseInt(split_date[1]), parseInt(split_date[0]), 0, 0, 0, 0).getTime(); console.log(d); let split_date2 = '02-02-2024'.split('-'); let d2 = new Date(parseInt(split_date2[2]),…

VIEW QUESTION

php time round up & round down

I am using the following function to round the time to closest 15 minutes. function roundTime($time){ $seconds = $time; $rounded_seconds = round($seconds / (15 * 60)) * (15 * 60); return date('H:i', $rounded_seconds) . "n"; } What I actually need…

VIEW QUESTION
Back To Top
Search