Skip to content

Conversation

@Octane0411
Copy link

@Octane0411 Octane0411 commented Jan 7, 2026

Description

Adds support for 24-hour time format in the TUI session view, addressing Issue #7208.

Users can now configure whether timestamps in the session view display in 12-hour (AM/PM) or 24-hour format.

Before & After

Before (12-hour format - default)

7bc66c04-e643-433e-bd20-f4b7f35de2e5

After (24-hour format)

52a1a39e-fc0e-4fc5-8a66-46cb8c9f9113

Changes

  • Added time_format configuration option to TUI settings (supports "12h" and "24h" formats)
  • Updated time formatting utilities (Locale.time, Locale.datetime, Locale.todayTimeOrDateTime) to accept format parameter
  • Applied time format configuration to:
    • Session list view
    • Fork from timeline dialog
    • Timeline view
  • Added unit tests for time formatting functions

Configuration Example

Add the following to your opencode.jsonc or .opencode/opencode.jsonc:

{
  "tui": {
    // Use 24-hour time format (default is 12-hour)
    "time_format": "24h"
  }
}

Or use 12-hour format explicitly:

{
  "tui": {
    "time_format": "12h"
  }
}

Testing

  • Session list displays correct time format based on configuration
  • Fork dialog shows correct time format
  • Timeline view respects time format setting
  • Unit tests pass for both 12h and 24h formats

Related Issue

Closes #7208

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

The following comment was made by an LLM, it may be inaccurate:

I found a potentially related PR:

PR #1888: Add configurable time format support
#1888

This PR appears to be related as it also deals with configurable time format support, though it may be an older or broader implementation. You may want to check if this PR overlaps with the current PR #7236 or if it was already merged/closed.

The other PRs that appeared in the search (OAuth usage display and terminal panel) are not related to time formatting.

@Octane0411
Copy link
Author

Note on Related Work

This PR addresses time format configuration for the current OpenCode 1.0+ TUI
(TypeScript/SolidJS, located in packages/opencode/src/cli/cmd/tui/).

There is a separate PR #1888 that addresses the same feature for the legacy
OpenCode 0.x TUI
(Go/BubbleTea, located in packages/tui/), which was replaced
in version 1.0 but is maintained for backward compatibility.

These implementations are independent and target different versions of OpenCode.

@Octane0411
Copy link
Author

Hi @thdxr, just a gentle bump on this PR.

It implements the 24-hour time format option requested in #7208. I've included unit tests and verified the UI changes locally.

Ready for review whenever you have a moment. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to use 24-hour time format in session view

1 participant