Skip to content

Instantly share code, notes, and snippets.

@sillygwailo
Created February 23, 2022 00:09
Show Gist options
  • Save sillygwailo/1f71c66531311afc51dba45d7f652d96 to your computer and use it in GitHub Desktop.
Save sillygwailo/1f71c66531311afc51dba45d7f652d96 to your computer and use it in GitHub Desktop.
#! /bin/bash
# Enter a time using 24H. 1:30pm is 13:30 .
ENTERTIME="%filltext:name=Time (in 24H)%"
# See https://gist.github.com/palaniraja/f8e21e8c66eac7e1b313 for a
# list of time zone names.
T1=$(TZ="America/New_York" date -jf "%H:%M %z" "$ENTERTIME $(date "+%z")" "+%-I:%M %p %Z" | tr -s '[:lower:]' '[:upper:]')
T2=$(TZ="Asia/Calcutta" date -jf "%H:%M %z" "$ENTERTIME $(date "+%z")" "+%-I:%M %p %Z" | tr -s '[:lower:]' '[:upper:]')
echo -n "$T1 / $T2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment