diff options
author | Xiao Pan <xyz@flylightning.xyz> | 2025-07-10 10:56:55 +0800 |
---|---|---|
committer | Xiao Pan <xyz@flylightning.xyz> | 2025-07-10 10:56:55 +0800 |
commit | 424219312c02150c94b7983b6539fc3e7ac7a3c5 (patch) | |
tree | 393865f188dc1e8c842cc4b9922529ab8b197bc3 /sh | |
parent | d9a4056f738aff322d2c350b3d62a3e4f00cdcfa (diff) |
dateft no need to display Beijing time because I moved
Diffstat (limited to 'sh')
-rwxr-xr-x | sh/dateft | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,9 +1,9 @@ #!/bin/sh # DATE From To -while getopts cfF:t:T: opt; do +while getopts fF:t:T: opt; do case $opt in - c) tz_from="Asia/Shanghai";; + #c) tz_from="Asia/Shanghai";; f) tz_from="$(tzselect)";; F) tz_from="$OPTARG";; # one extra ',' at the end will not let `for tz in ...` loop one extra time? @@ -19,7 +19,7 @@ shift $((OPTIND-1)) time_from="TZ=\"${tz_from:-$(readlink /etc/localtime | sed 's#.*/\(.*/.*\)$#\1#')}\" ${1:-now}" date -d "$time_from" -TZ="Asia/Shanghai" date -d "$time_from" +#TZ="Asia/Shanghai" date -d "$time_from" date -d "$time_from" -u date -d "$time_from" +%s [ "$tz_from" ] && [ "$tz_from" != "Asia/Shanghai" ] && TZ="$tz_from" date -d "$time_from" |