GMT <-> JST 変換するスクリプト。仕事柄、しょっちゅう時差の計算をしないといけないので。
GMTからJSTへ変換 (プラス9時間するだけ)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## GMT to JST | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 [\"yyyy/mm/dd 00:00]\"" | |
fi | |
## if no arguments, shows date 9hours later from current | |
date -d "$1 9hours" |
JSTからGMTへ変換 (マイナス9時間するだけ)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## JST to GMT | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 [\"yyyy/mm/dd 00:00]\"" | |
fi | |
## if no arguments, shows date 9hours before from current | |
date -d "$1 9hours ago" |
以上。