modern_lisp-machine/misc/scripts/date.sh

24 lines
850 B
Bash
Raw Normal View History

2024-03-02 23:05:55 +00:00
# Get the current date and time in Japanese-style format
japanese_datetime=$(date '+%Y年%m月%d日 %H時%M分%S秒')
2024-03-02 21:22:03 +00:00
# Get the current day of the week in English
english_day=$(date '+%A')
# Convert English day name to Japanese day name
case $english_day in
Monday) japanese_day="月曜日" ;;
Tuesday) japanese_day="火曜日" ;;
Wednesday) japanese_day="水曜日" ;;
Thursday) japanese_day="木曜日" ;;
Friday) japanese_day="金曜日" ;;
Saturday) japanese_day="土曜日" ;;
Sunday) japanese_day="日曜日" ;;
*) japanese_day="Unknown" ;; # Handle unexpected values
esac
# Combine the Japanese-style date with the Japanese day name, adding spaces
2024-03-02 23:05:55 +00:00
japanese_date_with_day=" $japanese_datetime $japanese_day"
2024-03-02 21:22:03 +00:00
2024-03-02 23:05:55 +00:00
# Output the formatted date, time, and day in Japanese
2024-03-02 21:22:03 +00:00
echo "📅 $japanese_date_with_day "