zed icon indicating copy to clipboard operation
zed copied to clipboard

time differences should be durations

Open mccanne opened this issue 4 years ago • 1 comments

echo '{ts:2018-03-24T17:30:20Z}' | zq 'cut delta:=(ts+1s)-ts' -

is

{delta:1970-01-01T00:00:01Z}

but should be

{delta:1s}

mccanne avatar Oct 02 '21 17:10 mccanne

Yep. This has been with us for a while. I just closed #1792 as a duplicate.

philrz avatar Oct 02 '21 17:10 philrz

Just closed another duplicate, #3741. Note that community user @cogphn took the time to react with a 🎉 emoji to that other issue, so there's outside interest in seeing this addressed. I've therefore added the Community label here and will discuss with the team boosting its priority.

philrz avatar Sep 14 '22 17:09 philrz

Verified in Zed commit 28f95a3.

The output is now a duration type as was originally anticipated.

$ zq -version
Version: v1.2.0-64-g28f95a3c

$ echo '{ts:2018-03-24T17:30:20Z}' | zq 'cut delta:=(ts+1s)-ts' -
{delta:1s}

Thanks @nwt!

philrz avatar Sep 27 '22 21:09 philrz