Skip to content

time.Duration > 24 hours not working as expected #2004

Closed
@nielskrijger

Description

@nielskrijger

Description

time.Duration > 24 hours is formatted differently than time.Duration < 24.

Steps to reproduce the issue:

  1. See playground: https://go.dev/play/p/NNpUJCVFju8

Describe the results you received:

A1 is as expected (duration < 24 hours):

Screenshot 2024-10-02 at 09 45 50

A2 is not usable (duration > 24 hours):

Screenshot 2024-10-02 at 09 45 53

Describe the results you expected:

A2 containing 24:51:44 (or anything equivalent in Excel that works as a duration).

In our use case we select the column and have Excel "Sum" the durations to a total. This works fine if the individual cells are formatted as 21:33:55 as long as each individual value doesn't go beyond 24 hours. Any value beyond 24 hours breaks this.

Output of go version:

go1.22.3 darwin/amd64

Excelize version or commit ID:

v2.8.1

Environment details (OS, Microsoft Excel™ version, physical, etc.):

Mac OS. Excel Version 16.89.1 (24091630).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions