# uses_24_hour_clock

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/formatting/uses_24_hour_clock)

Whether the system is configured for a 24-hour clock.

On macOS the clock style lives in the `AppleICUForce24HourTime` system
preference rather than the POSIX locale, so that is consulted first (see
`macos_force_24_hour_time`). When that preference is unset we intentionally
default to a 24-hour clock: macOS resolves the region's 12-/24-hour default
via ICU/CFLocale, which POSIX cannot read (libc `%X` is 24-hour for every
macOS locale), so the locale probe below would be meaningless there.

On every other platform the active `LC_TIME` locale's time representation
is probed instead.

The result is cached because resolving it mutates process-global locale
state via `locale.setlocale(locale.LC_TIME, "")` (scoped to the time
category, and only ever performed once).

## Signature

```python
uses_24_hour_clock() -> bool
```

## Returns

`bool`

`True` for a 24-hour clock (also the fallback when the macOS preference

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/0412009c5441bef8d75a427e1da8909e33ab5b56/libs/code/deepagents_code/formatting.py#L68)