trim timestamps
mbailey opened this issue · comments
Mike Bailey commented
We could reduce line width by shaving the ends off timestamps when listing a resource:
- remove seconds and miliseconds
Any cons?
2019-05-06T06:39:05.510Z 2019-05-10T03:17:14.772Z
Anatoly Pugachev commented
not sure about seconds, but definitely could remove milliseconds.
thanks.
Mike Bailey commented
Mike Bailey commented
Should still be done
nitrocode commented
This might be hard to do with jmespath as there is no slice or split function at the moment.
jmespath/jmespath.jep#5
jmespath/jmespath.jep#3
There is a jq option if we want to split on the characters T
(to get only date) or .
(to remove milliseconds)
Mike Bailey commented
This will trim them:
$ stacks | sed 's/\([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}T[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}\)\S*/\1/g'
docker-stack-bash-my-aws CREATE_FAILED 2020-03-12T12:19:48 NEVER_UPDATED NOT_NESTED
elbv2 CREATE_COMPLETE 2021-03-09T13:38:08 NEVER_UPDATED NOT_NESTED
Much better than without:
$ stacks
docker-stack-bash-my-aws CREATE_FAILED 2020-03-12T12:19:48.446000+00:00 NEVER_UPDATED NOT_NESTED
elbv2 CREATE_COMPLETE 2021-03-09T13:38:08.326000+00:00 NEVER_UPDATED NOT_NESTED