Basic Command Line Date/Timestanp Examples
Epoch Seconds
date +%s
Timezone
date +%z
Timezone without newline
printf "%s" $(date +%z)
Timestamp Variable
#!/bin/bash
TIMESTAMP=$(date +%Y-%m-%dT%H:%M:%S)
echo $TIMESTAMP
Results
2017-09-08T09:51:04
date +%s
date +%z
printf "%s" $(date +%z)
#!/bin/bash
TIMESTAMP=$(date +%Y-%m-%dT%H:%M:%S)
echo $TIMESTAMP
2017-09-08T09:51:04