Title: formatting | deepagents_code | LangChain Reference
Open Graph Title: formatting | deepagents_code
X Title: formatting | deepagents_code
Description: Python API reference for formatting in deepagents_code. Part of the LangChain ecosystem.
Open Graph Description: Python API reference for formatting in deepagents_code. Part of the LangChain ecosystem.
X Description: Python API reference for formatting in deepagents_code. Part of the LangChain ecosystem.
Opengraph URL: https://reference.langchain.com/python/deepagents-code/formatting
Domain: reference.langchain.com
| og:image | https://reference.langchain.com/og/python/deepagents-code/formatting |
| og:image:width | 1200 |
| og:image:height | 630 |
| og:image:alt | formatting | deepagents_code |
| og:type | article |
| twitter:card | summary_large_image |
| twitter:image | https://reference.langchain.com/og/python/deepagents-code/formatting |
Links:
| LangChain Reference home page | https://reference.langchain.com/ |
| GitHub | https://github.com/langchain-ai |
| Main Docs | https://docs.langchain.com/oss/python/deepagents |
| Deep Agents | https://reference.langchain.com/python/deepagents |
| LangChain | https://reference.langchain.com/python/langchain/overview |
| LangGraph | https://reference.langchain.com/python/langgraph/overview |
| Integrations | https://reference.langchain.com/python/integrations/overview |
| LangSmith | https://reference.langchain.com/python/langsmith |
| Deep Agents Code | https://reference.langchain.com/python/deepagents-code |
| Deep Agents Code | https://reference.langchain.com/python/deepagents-code |
| deepagents-code | https://reference.langchain.com/python/deepagents-code |
| attributelogger | https://reference.langchain.com/python/deepagents-code/formatting/logger |
| functionformat_durationFormat a duration in seconds into a human-readable string. | https://reference.langchain.com/python/deepagents-code/formatting/format_duration |
| functionmacos_force_24_hour_timeRead macOS's "24-Hour Time" preference (AppleICUForce24HourTime). macOS exposes the clock style as a global preference that does not surface through the POSIX LC_TIME locale (libc %X is 24-hour for every macOS locale), so it must be read separately. | https://reference.langchain.com/python/deepagents-code/formatting/macos_force_24_hour_time |
| functionuses_24_hour_clockWhether 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). | https://reference.langchain.com/python/deepagents-code/formatting/uses_24_hour_clock |
| functionformat_message_timestampFormat a message timestamp for display. Shows only the time of day for messages from the current local date and prefixes the date otherwise. The 12- versus 24-hour clock follows the system configuration (see uses_24_hour_clock). | https://reference.langchain.com/python/deepagents-code/formatting/format_message_timestamp |
| View source on GitHub | https://github.com/langchain-ai/deepagents/blob/bd9bafaad3f51d426563aa24658bbb3a089d4825/libs/code/deepagents_code/formatting.py |
Viewport: width=device-width, initial-scale=1