Skip to content

Support ISO 8601 Duration formatting for RTClib's TimeSpan #181

Open
@maxbla

Description

@maxbla
  • Arduino board: N/a (but I am testing code regularly on an Arduino Mega 2560)
  • Arduino IDE version: 1.8.13

This library provides support for ISO 8601 formatted DateTimes through the toString and timestamp methods, but doesn't have a similar option for TimeSpans. ISO 8601 specifies two formats for durations. (Durations appear to be basically the same thing as this library's TimeSpans)

I would like to add methods that format TimeSpans according to ISO 8601's PnYnMnDTnHnMnS or P<date>T<time> formats, both a zero allocation version (not sure what to call it, maybe format?) and one that returns a std::string called toString. I would also add a TimeSpan constructor taking one argument of const char *iso8601duration. Do you think this feature belongs in this library and would you consider merging a PR containing the changes I laid out?

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