Time input in Safari has the wrong date format


As you can see on the screenshot the System time is shown in the 24 hour format, which is correct.

In safari the time is in AM/PM which is not desired.


I have found no way to fix this.


This is the HTML of the website:


<html><head>
</head>
<body>
<form action="/" method="post">
<label for="">
Date to set:
<input id="date" type="date" name="date">
</label>
<label for="">
Time to set:
<input id="time" type="time" name="time">
</label>

<input type="submit" value="Update!">
</form>
<script>
document.getElementById('date').valueAsDate = new Date();
let now = Date.now();
let hours = new Date(now).getHours();
let minutes = new Date(now).getMinutes();
document.getElementById('time').value = `${hours}:${minutes}`;
</script>


</body></html>

MacBook Air 13″, macOS 15.5

Posted on May 29, 2025 08:33 AM

Reply
3 replies

May 30, 2025 02:01 PM in response to b-m-f

According to https://stackoverflow.com/questions/13523060/how-to-change-the-time-format-12-24-hours-of-an-input, this is a known bug in a number of browsers. I did not investigate that claim extensively though.


Interestingly enough, if you open your code in the long discontinued Dissenter browser, it works as you intended:



Unfortunately it does not work correctly in Brave, Firefox, Safari, or Opera. Only Dissenter... and it's gone.


Try Vivaldi. I don't happen to have it.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Time input in Safari has the wrong date format

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.