Just browsing through some older requests about 24 hour formatting for Date Time Display.
Just curious that Chromium haven’t really documented about it.
For the general users reading looking for help:
It’s handy to know that modern electronic devices (in this example: desktop computers) could potentially have three ‘Clock’ or ‘Time’ references because:
- System Time (The Operating System Time)
- User’s Local Time (This could override System time, and also carry the relevant data for display format and User Locale/Languages)
- Application Time (The application in use could have its own time variable)
Sync issues can occur by having different timestamps.
For Brave Developers reading:
This is the “New Tab” source
> <!doctype html>
> <html data-test-id="brave-new-tab-page">
> <head>
> <meta charset="utf-8">
> <meta name="viewport" content="width=device-width">
> <title>New Tab</title>
[> <link rel="stylesheet" href="chrome ://resources/css/text_defaults.css">
> <link rel="import" href="chrome ://resources/html/cr.html">
> <script src="chrome ://resources/js/cr.js"></script>
> <script src="chrome ://resources/js/load_time_data.js"></script>
> <script src="chrome ://resources/js/util.js"></script>
> <script src="chrome ://resources/js/i18n_template_no_process.js"></script>
> <script src="/strings.js"></script>
> <script src="/brave_new_tab.bundle.js"></script>]
> <style>
> #root { height: 100%; }
> @media (prefers-color-scheme: dark) {
> body { background-color: #333639; }
> }
> </style>
> </head>
> <body>
> <div id="root"></div>
> </body>
> </html>
with a snippet from the load_time_data.js
@fileoverview This file defines a singleton which provides access to all data
that is available as soon as the page’s resources are loaded (before DOM
content has finished loading). This data includes both localized strings and
any data that is important to have ready from a very early stage (e.g. things
that must be displayed right away).
Note that loadTimeData is not guaranteed to be consistent between page
refreshes (https:// crbug[.]com/740629) and should not contain values that might
change if the page is re-opened later.
In addition to the New Tab loading <script src="chrome ://resources/js/load_time_data.js"></script>
Here is a better example of how the date and time variables can be accessed and include the formatting at the same time and could probably be included for the Brave Settings scripts.
The following threads below are some of the original requests related to system/user/browser time and formatting.