How do I get GMT time in Unix?

Sam picture Sam · Nov 19, 2012 · Viewed 58.3k times · Source

If my Unix machine is set to IST timezone, how can I get the current GMT time?

Answer

codaddict picture codaddict · Nov 19, 2012

You can use the -u option of date command:

date -u

-u Display (or set) the date in Greenwich Mean Time (GMT-universal time), bypassing the normal conversion to (or from) local time.