Last active
December 26, 2015 10:49
-
-
Save r10r/7139317 to your computer and use it in GitHub Desktop.
ASN1 date 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
DATE_FORMAT_ASN1="%y%m%d%H%M%SZ" | |
# @stdout: ASN1 formatted date string | |
# $1: offset expression (seconds) eg. 24 hours: '+(60*60*24)' | |
date_asn1() { | |
local offset=$1 | |
date -j -f %s `echo $(date +%s)${offset}|bc` +${DATE_FORMAT_ASN1} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment