{"id":13587801,"url":"https://github.com/chmouel/batzconverter","last_synced_at":"2025-05-13T00:44:39.559Z","repository":{"id":66897077,"uuid":"129234172","full_name":"chmouel/batzconverter","owner":"chmouel","description":"If batman needed a tz converter to show times between different timezones that would be it 🦇","archived":false,"fork":false,"pushed_at":"2023-05-11T06:13:26.000Z","size":1688,"stargazers_count":17,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-02-13T21:57:17.378Z","etag":null,"topics":["alfred","bash","date","linux","mac-osx","timezone","windows"],"latest_commit_sha":null,"homepage":"https://blog.chmouel.com/2021/01/31/batzconverter-a-multiple-timezone-converter/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chmouel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-04-12T10:27:34.000Z","updated_at":"2024-02-13T21:57:24.911Z","dependencies_parsed_at":"2024-02-13T21:57:23.287Z","dependency_job_id":"9460912b-e24c-400e-8b83-d5e5aa359cca","html_url":"https://github.com/chmouel/batzconverter","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chmouel%2Fbatzconverter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chmouel%2Fbatzconverter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chmouel%2Fbatzconverter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chmouel%2Fbatzconverter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chmouel","download_url":"https://codeload.github.com/chmouel/batzconverter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253850875,"owners_count":21973671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alfred","bash","date","linux","mac-osx","timezone","windows"],"created_at":"2024-08-01T15:06:22.164Z","updated_at":"2025-05-13T00:44:39.515Z","avatar_url":"https://github.com/chmouel.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# batzconverter - Batman Timezone Converter\n\nShow times in different timezone with bash\n\n## Blog post\n\n\u003chttps://blog.chmouel.com/2021/01/31/batzconverter-a-multiple-timezone-converter/\u003e\n\n## Demo\n\n![See screenshot](./share/screenshot.png)\n\n## INSTALL\n\ngrab the shell script directly from this repo and put it in your path, or just copy and paste this :\n\n```bash\n#  will try to install in /usr/local if you have the right or $HOME/.local/bin need to be in your path\ndest=\"/usr/local/bin\"\n[[ -w ${dest} ]] || { dest=${HOME}/.local/bin;mkdir -p ${dest} ;}\ncurl -f -L -o ${dest}/batz https://raw.githubusercontent.com/chmouel/batzconverter/master/batz.sh \u0026\u0026 \\\n        chmod +x ${dest}/batz \u0026\u0026 \\\n echo \"'The' batz has been installed into: ${dest}/batz\"\n```\n\n## Settings\n\nCreate a file in `~/.config/batz/config` and add configure the `TIME_ZONES` and `TIME_ZONES_EMOJI` variable like this :\n\n```shell\n## Change the default timezones here!\nTIME_ZONES=(\n  [\"India\"]=\"Asia/Calcutta\"\n  [\"Europe\"]=\"Europe/Paris\"\n  [\"US-East\"]=\"America/New_York\"\n  [\"US-West\"]=\"America/Los_Angeles\"\n)\n\nTIME_ZONES_EMOJI=(\n [\"India\"]=\"🇮🇳 \"\n [\"Europe\"]=\"🇪🇺 \"\n [\"US-East\"]=\"🇺🇸 \"\n [\"US-West\"]=\"🐻\"\n)\n\nDATE_FORMAT=\"%b %Hh%M\"\nDATE_FORMAT_PADDING=10\nDEFAULT_TIME_ZOME_EMOJI=\"🌐\"\n```\n\nThe format is :\n\n    \"TZ_Alias_Name\"=\"Timezone\"\n\nfor example :\n\n    \"HomeSweetHome\"=\"Europe/Paris\"\n\nYou can look an example in my config [here](https://gitlab.com/chmouel/rc-config/-/blob/main/batz/config)\n\n## Requirement\n\nSome pretty modern Bash \u003e4.0 and modern GNU Date. On MacosX install those from brew (bash and gnuutils).\n\n## Usage\n\n```bash\n% batz\n% batz 10h30\n% batz 10h30 next week\n% batz 11:00 next thursday\n```\n\nBaTZ  will show all different timezone for the timeformat\n\nYou can as well add multiple timezones directly on the command line like this :\n\n```bash\n% batz +America/Chicago +UTC 10h00 tomorrow\n```\n\nIf you don't know the timezone and you have the\n[fzf](https://github.com/junegunn/fzf) utility installed you can use the `-f`\noption to select interactively the timezone. You can select multiple timezone\nby using the `TAB` key in fzf.\n\nBy default this script will try to detect your current timezone, if you want\nto say something like this:\nshow me the different times tomorrow if I were at 10h00 AM on UTC timezone, you can do :\n\n```bash\n% batz -t UTC 10h00\n````\n\nWhen you set another timezone than your current one, it wil show a nice ✈️emoji\nnear your different base timezone, or by default it will show a 🏠 emojis to\nemphasis the current timezone in your copy and paste.\n\n*If you want to add extra timezone with +TZ you need to do at first before the\noptions, cause bash getopt is kind of buggy in this regard*\n\nYou can use the `-j` option to output as json and may do some parsing with it.\n(this is used by the Alfred suppoort).\n\nIf you have the [gum](https://github.com/charmbracelet/gum) utility installed\nyou can use the flag `-g` to show the timezone using the gum tables You can as\nwell set `USE_GUM=1` in your config file to set it as default.\n\nThe output looks for example like this for me:\n\n![image](https://github.com/chmouel/batzconverter/assets/98980/434344f5-1b1d-4d7d-b9ac-db23b2548bb6)\n\n\nYou can add the `-n` argument to batz to not show any colours or emojis. It\nwill respect the [`NO_COLOUR`](https://no-color.org/) environment variable as\nwell.\n\n## [Rofi](https://github.com/davatorium/rofi) Support\n\nTake this rofi script [rofibatz.sh](./share/rofibatz.sh) and place it somewhere, i.e: `~/.config/rofi/rofibatz.sh`, launch it up like this :\n\n`rofi -modi batz:${HOME}/.config/rofi/rofibatz.sh -show batz`\n\nYou can type batz string i.e: `13h00 tomorrow` when you press enter it will evaluate it.\n\nI have a [custom theme](https://github.com/chmouel/mounch/blob/main/rofi/mounch.rasi) so your mileage may vary but for me it will be shown like this :\n\n![See screenshot](./share/rofibatz.png)\n\n## [Wofi](https://hg.sr.ht/~scoopta/wofi) Support\n\n![Screenshot_2021-11-23-23:24 03](https://user-images.githubusercontent.com/98980/143138764-574a7885-dc02-4c78-ad24-0c44d88f1bc0.png)\n\nJust do something like this assuming you have wofi and wl-copy installed :\n\n```shell\nwl-copy $(batz|sed -e \"s/\\x1b\\[.\\{1,5\\}m//g\"|wofi -d|sed 's/.* : //')\n```\n\nwill only get you the timezone since wofi doesnt support scripts (afaik)\n\n## [Alfred](https://www.alfredapp.com/) Support\n\nBaTZ support [alfred](https://www.alfredapp.com/), it basically output nicely the timezone from alfred in a nice way.\n\n![See screenshot](./alfredworkflow/screenshot.png)\n\nJust install the [alfredworlflow file](./alfredworkflow/TZ.alfredworkflow) from the repository\nand make sure the batz script is in one of these path: `$HOME/bin/` or `/usr/local/bin/`\n\n## [Zenity](https://help.gnome.org/users/zenity/stable/) support\n\n```shell\noutput=$(zenity --entry --text \"🦇Time\" --entry-text $(date ''+%H:%M''));[[ -n $output ]] \u0026\u0026 batz $output|wl-copy',\n```\n\n## Copyright\n\n[Apache-2.0](./LICENSE)\n\n## Authors\n\nChmouel Boudjnah \u003c[@chmouel](https://twitter.com/chmouel)\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchmouel%2Fbatzconverter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchmouel%2Fbatzconverter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchmouel%2Fbatzconverter/lists"}