Last active
March 1, 2018 14:47
-
-
Save YakDriver/e80970fb46bc861fa34fa1f6319e93fc to your computer and use it in GitHub Desktop.
Linux/bash to display date in UTC format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Many things want UTC time as input, so here it is. As 14 days ago. Like for a query to AWS spot instance history: | |
# aws ec2 describe-spot-price-history --instance-types t2.micro --start-time $(date -v-14d -u '+%FT%TZ') --product-description "Linux/UNIX" | |
# | |
# Output (of command below, not the aws cli command): | |
# 2018-02-13T15:24:46Z | |
# | |
date -v-14d -u '+%FT%TZ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment