config

Personal configuration.
git clone git://code.dwrz.net/config
Log | Files | Refs

commit f9cf30fa85265d1319fe1f4f6c247ba396d4e073
parent bf61ef237c3bf33ca36d72842847a7590766377a
Author: dwrz <dwrz@dwrz.net>
Date:   Fri,  1 Dec 2023 01:27:49 +0000

Add world-time script

Diffstat:
Ascripts/world-time | 25+++++++++++++++++++++++++
1 file changed, 25 insertions(+), 0 deletions(-)

diff --git a/scripts/world-time b/scripts/world-time @@ -0,0 +1,25 @@ +#!/bin/sh + +readonly FORMAT='+%Y-%m-%d %u/7 %H:%M %Z' + +now="@$(date +%s)" + +printf "%-11s %s\n" \ + "Los Angeles" \ + "$(TZ="America/Los_Angeles" date -d "${now}" "${FORMAT}")" + +printf "%-11s %s\n" \ + "New York" \ + "$(TZ="America/New_York" date -d "${now}" "${FORMAT}")" + +printf "%-11s %s\n" \ + "UTC" \ + "$(TZ="UTC" date -d "${now}" "${FORMAT}")" + +printf "%-11s %s\n" \ + "Napoli" \ + "$(TZ="Europe/Rome" date -d "${now}" "${FORMAT}")" + +printf "%-13s %s\n" \ + "上海" \ + "$(TZ="Asia/Shanghai" date -d "${now}" "${FORMAT}")"