Skip to content

Instantly share code, notes, and snippets.

@celoyd
Created February 19, 2018 06:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save celoyd/4b1bb324587af0a58d635d55314ee571 to your computer and use it in GitHub Desktop.
Save celoyd/4b1bb324587af0a58d635d55314ee571 to your computer and use it in GitHub Desktop.
when() {
local zone="$1";
case "$zone" in
("SF") zone="America/Los_Angeles";;
("CO") zone="America/Denver";;
("Montreal") zone="America/Montreal";;
("DC") zone="America/New_York";;
("BLR") zone="Asia/Kolkata";;
esac;
psql -At -c "select date_trunc('second', now() at time zone '$zone')";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment