Get current timezone on CentOS 7?
CentOS 7 specific:
timedatectl | gawk -F': ' ' $1 ~ /Timezone/ {print $2}'
And displaying just the timezone:
timedatectl | gawk -F'[: ]+' ' $2 ~ /Timezone/ {print $3}'
more generic:
date +%Z
CentOS 7 specific:
timedatectl | gawk -F': ' ' $1 ~ /Timezone/ {print $2}'
And displaying just the timezone:
timedatectl | gawk -F'[: ]+' ' $2 ~ /Timezone/ {print $3}'
more generic:
date +%Z