Skip to content

TIME values over 23 hours display "Valid hour range is 0-23" #93

Description

@szkaym

Description

When viewing a MySQL TIME column containing values greater than 23:59:59, MySQL Shell for VS Code displays the following error:

Valid hour range is 0-23

MySQL allows TIME values beyond 23 hours because the type can represent elapsed time. These values are valid and can be queried successfully using the MySQL CLI.

Steps to reproduce

CREATE TABLE time_test (
    value TIME
);

INSERT INTO time_test (value)
VALUES ('24:00:00'), ('25:30:00'), ('26:30:00');

SELECT * FROM time_test;

Expected behavior

The result grid displays the stored values:

  • 24:00:00
  • 25:30:00
  • 26:30:00

Actual behavior

The result grid reports:

Valid hour range is 0-23

Workaround

Casting the value to a string displays it correctly:

SELECT CAST(value AS CHAR) AS value
FROM time_test;

Additional context

This commonly occurs with attendance data where times after midnight are represented as extended hours, such as 25:30:00.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions