Skip to content

Instantly share code, notes, and snippets.

@adeekshith
Created November 16, 2023 23:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adeekshith/ac1a5755b4d022597b4d51861e1d3f57 to your computer and use it in GitHub Desktop.
Save adeekshith/ac1a5755b4d022597b4d51861e1d3f57 to your computer and use it in GitHub Desktop.
WorldTime - Show time in different timezones in the commandline
#!/bin/bash
echo "UTC: $(TZ='UTC' date +'%H:%M %Y-%m-%d %a')"
echo "-------------------------"
echo "EST: $(TZ='America/New_York' date +'%H:%M %Y-%m-%d %a')"
echo "CST: $(TZ='America/Chicago' date +'%H:%M %Y-%m-%d %a')"
echo "PST: $(TZ='America/Los_Angeles' date +'%H:%M %Y-%m-%d %a')"
echo "-------------------------"
echo "IST: $(TZ='Asia/Kolkata' date +'%H:%M %Y-%m-%d %a')"
# Ref: Timezone abbreviations: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment