When I run
date +"%Y%m%d%H%M%S" I receive
20171225203309 here in CET time zone.
Can I use
date to obtain a the current time in the same format, but for timezone GMT?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
You can use
date -u (universal time) which is equivalent to GMT.
‘-u’ ‘--utc’ ‘--universal’
Use Universal Time by operating as if the ‘TZ’ environment variable were set to the string ‘UTC0’. UTC stands for Coordinated Universal Time, established in 1960. Universal Time is often called “Greenwich Mean Time” (GMT) for historical reasons. Typically, systems ignore leap seconds and thus implement an approximation to UTC rather than true UTC.