Slotpicker: Changing AM/PM to 24hrs format

Hey guys,
so I got this code in my website:

// Get the time of the given date formatted as HH:MM AM/PM.
function getTimeOfDay(date) {
return date.toLocaleTimeString([], { hour: “2-digit” , minute: “2-digit” });

it’s a part of a custom booking form a developer had once made for me, in the slotpicker dropdown.
I would like to change it to show a 24 hours format (16:00 as 4PM etc)
How should I change the code?

date.toLocaleTimeString("en-GB",  { hour: "2-digit", minute: "2-digit" })

KING! that worked

You’re welcome :slight_smile: