start-ts and end-ts do not work as documented

Description

How To Repeat

From the documentation at https://github.com/Percona-Lab/pmm-import-export-tool/:

export start-ts Start date-time to limit timeframe 2006-01-02T15:04:05Z07:00
export end-ts End date-time to limit timeframe 2006-01-02T15:04:05Z07:00

However, if I try to use these options as described I get error:

$ ../pmm-transferer export --pmm-url='http://admin:admin@127.0.0.1' --start-ts='2021-09-14T00:00:00Z00:00' --end-ts='2021-09-14T12:00:00Z00:00' 2021-09-15T23:54:13Z FTL Error parsing end date-time: parsing time "2021-09-14T12:00:00Z00:00": extra text: "00:00"

After researching on the Internet I found this page: https://yourbasic.org/golang/format-parse-string-time-date-example/, then tried format for time zones, described there and get pmm-transferer working.

E.g.,

$ ../pmm-transferer export --pmm-url='http://admin:admin@127.0.0.1' --start-ts='2021-09-14T00:00:00-03:00' --end-ts='2021-09-14T12:00:00+03:00'

Suggested Fix

Check if the tool practically works as suggested and either fix the tool, or update README.

Environment

None

Smart Checklist

Activity

Sveta Smirnova November 17, 2021 at 12:21 PM

README fixed in 1e7c0110d1837e2a98be89174f1ea091e54a2a25

Sveta Smirnova November 5, 2021 at 2:28 PM

you put a great explanation into this comment but I do not see it in the README at https://github.com/Percona-Lab/pmm-import-export-tool/blob/main/README.md It just says that time should be in RFC3339 format. However, I do not expect end-users to know what this format is.

Andrii Dema September 22, 2021 at 11:37 AM

I have updated the README file. start-ts/end-ts values are expected to be in RFC3339 format.

2006-01-02T15:04:05Z07:00 means that character Z should be replaced with + or - when UTC timezone is not used, but when UTC timezone is used, it's invalid to specify offset after Z character.
Here are some examples of how you can specify time in this format:

  • 2006-01-02T15:04:05Z in UTC timezone

  • 2006-01-02T15:04:05+03:00 in timezone with +03:00 offset from UTC

Done

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Smart Checklist

Created September 15, 2021 at 11:57 PM
Updated March 7, 2024 at 9:37 AM
Resolved November 17, 2021 at 12:21 PM

Flag notifications