Cylc cyclepoint and the letter "T"

cylc 8.4.2

cylc 8.4.2

> export CYLC_TASK_CYCLE_POINT=20230120T0000Z
> cylc cyclepoint --offset-hours=0 --template="a string with %Y%m%d%H"
a string with 2023012000
> cylc cyclepoint --offset-hours=0 --template="a string with no tags"
a string with no tags
> cylc cyclepoint --offset-hours=0 --template="a string with no Tags"
a string with no 

You can try it yourself! The cylc cyclepoint parser will stop when it encounters a capital T.

Well that’s interesting.

Probably something to do with the special status of T in datetime strings.

Have you got a use case that this breaks?

If so, have you tried using the more general isodatetime command? - it should be in your Cylc environment.

(Note the cylc cyclepoint command help mentions isodatetime)

Hi,
I can confirm that isodatetime does not show this behavior:

> isodatetime --version
3.1.0
> isodatetime --print-format “a string with %Y%m%d%H”
a string with 2025080800
> isodatetime --print-format “a string with no tags”
a string with no tags
> isodatetime --print-format “a string with no Tags”
a string with no Tags

1 Like

The cylc cyclepoint command is a rather old utility, I would recommend using isodatetime for your datetime formatting/arithmetic needs.

Isodatetime is one of our projects and a direct dependency of Cylc so is safe to rely on.

(This bug did exist in isodatetime but was fixed in 3.0.0 - Fix missing T in dump when formatting_string has time zone after T by MetRonnie · Pull Request #154 · metomi/isodatetime · GitHub)

1 Like