startDate output format doesn't match date input format.
I would like to have a command that will give me a list of my next few events with the (12H) time they start. So, I started with the example for a daily events, and I run this to get a json list of events for the day:
ekctl list events --calendar work --from "$NOWISH" --to "$TOMORROW" |
And then I expect to be able to pipe that through jq like this:
jq '.events.[] | {title,startDate:.startDate | strptime("%Y-%m-%dT%H:%M:%S%:z")|mktime|strftime("%I:%M%p") } | "(.startDate) (.title)"'
But I get an error jq: error (at <stdin>:36): date "2026-03-09T16:00:00-04:00" does not match format "%Y-%m-%dT%H:%M:%S%:z"
JQ doesn't do a great job handling timezone/locale, so its not too surprising to get an error parsing (because the TZ has the colon in it). However, I was surprised that the format of the startDate in the output didn't match the format expected for input to --from and --to.
I will submit a PR. It looks like the issue is documented behavior due to differences between acceptable ISO 8601 dates and RFC 3339-specific dates.
Quick status, @nbonfire — this one's parked on the linked PR (#4) rather than getting an immediate fix in main. Summary of where it landed:
The underlying jq pain point (%:z not parsing the colon-separated offset reliably) is real, but the proposed fix of switching the global output format to +1100 (no colon) collides with two earlier choices:
- The colon-separated form (
+11:00) was a deliberate decision in commit 05243fe — explicitly noted in the message as the chosen format. - RFC 3339 §5.6 mandates the colon in the numeric offset, so dropping it would leave us valid ISO 8601 but no longer RFC 3339.
Left a longer comment on #4 with a few alternative paths — the most promising being an opt-in --time-format compact|rfc3339 flag so jq-friendly output is available without changing the default underneath existing consumers. Keeping this issue open while that conversation continues on the PR.
Quick update, @nbonfire — the broader 'I want a different output shape for scripting' angle now has an answer in c3b8f68: every command takes --format json|csv|text. Doesn't change the underlying ISO8601DateFormatter colon question (the dates themselves are still RFC 3339 in all three formats — that's still the open trade-off), but it gives you a couple of paths that bypass jq's %:z quirk entirely if you want them:
# Spreadsheet-friendly — header + rows, dates as strings, no jq required
ekctl list events --calendar work --from "$NOWISH" --to "$TOMORROW" --format csv
# Greppable — one 'key: value' line per field, blank line between events
ekctl list events --calendar work --from "$NOWISH" --to "$TOMORROW" --format text
CSV/text auto-discover their fields from the same dictionary that produces JSON, so they won't lag as new fields (availability, attendees, …) get added.
Leaving this issue open for the underlying RFC 3339 / jq question, since that's still a real design choice independent of having more output shapes available.
Fixed in v1.5.0 from both directions:
1. Output: opt-in --time-format compact (09f55d5 / 289736a). Every command now takes --time-format rfc3339|compact. The default stays RFC 3339 (+11:00, Z) so existing consumers see no change, but compact renders +1100-style offsets — and +0000 instead of Z — which is exactly the form jq's strptime %z parses. Your original use case now works directly:
# the next few events with their 12-hour start times
ekctl next --calendar work --count 5 --time-format compact |
jq -r '.events[] | "\(.startDate | strptime("%Y-%m-%dT%H:%M:%S%z") | strftime("%I:%M%p")) \(.title)"'
2. Input: the original mismatch is gone. --from/--to/--start/--end/--due/--recurrence-end-date all accept Z, +11:00, and +1100 offsets, with or without fractional seconds. The invariant (now pinned by tests): every timestamp ekctl can emit, in either time format, is valid ekctl input — output round-trips back into the CLI.
The default output stays colon-separated per RFC 3339 §5.6 (the concern that parked #4), so this lands the jq-friendly form without changing anything underneath existing scripts. Docs are in the README's Date Format section, and v1.5.0 ships prebuilt binaries if you want to grab it without building.
Thanks for the detailed report, @nbonfire — the round-trip framing ("output should be valid input") is what shaped the fix.