Skip to content

Is there a way to get the TimeDelta in an human-friendly way like "10h26m"? #1616

@frederikhors

Description

@frederikhors

I opened an old project that was using time crate.

I have this code:

let diff = end_date - start_date;

let result = diff.to_string();

and result there is "10h26m".

Now with chrono crate I get something like: "PT15240S".

Is there a way to get the result like with the time crate, in a more human friendly way?

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