I'm building a list of EBS Volumes in AWS.
I need to put the create time into a more user-friendly format. Management complains about unreadable times.
If I run this command it gives me the time the volume was created in this format:
aws ec2 describe-volumes --volume-ids vol-066e24cb8d2294605 | jq -r '.Volumes[].CreateTime'
2018-12-11T18:54:26.110Z
I'm trying to format the time using strftime, but it doesn't work. What I get is this error:
aws ec2 describe-volumes --volume-ids vol-066e24cb8d2294605 | jq -r '.Volumes[] | .CreateTime | strftime ("%Y-%m-%d %H:%M:%S")'
jq: error (at <stdin>:39): strftime/1 requires parsed datetime inputs
What is the problem I'm having? How can I create a user friendly time given the time format provided to me by AWS?