Skip to content

Instantly share code, notes, and snippets.

@r10r
Last active December 26, 2015 10:49
Show Gist options
  • Save r10r/7139317 to your computer and use it in GitHub Desktop.
Save r10r/7139317 to your computer and use it in GitHub Desktop.
ASN1 date format
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