summaryrefslogtreecommitdiff
path: root/.bashrc
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2024-12-30 21:51:48 +0200
committerSyndamia <kamen@syndamia.com>2024-12-30 21:51:48 +0200
commitd790867f0701e861762310aaa93736e0c030c4fa (patch)
tree58e80e451e082e52b938e06c72a1f9b23d106812 /.bashrc
parentda53f478f4808fdad0fc1e4b322e98f94d9b116c (diff)
downloaddotfiles-d790867f0701e861762310aaa93736e0c030c4fa.tar
dotfiles-d790867f0701e861762310aaa93736e0c030c4fa.tar.gz
dotfiles-d790867f0701e861762310aaa93736e0c030c4fa.zip
fix(bash): Show days elapsed properly
Before it was always +1, becuase %j counts the day from start, and in UTC timezone we start on day 1. With UTC+24 we start on the last day of last year, so when we get to the next day, it's the first.
Diffstat (limited to '.bashrc')
-rw-r--r--.bashrc8
1 files changed, 4 insertions, 4 deletions
diff --git a/.bashrc b/.bashrc
index b374b15..b3029db 100644
--- a/.bashrc
+++ b/.bashrc
@@ -151,10 +151,10 @@ export PROMPT_COMMAND="shell_var_fix;"
if [ "$seconds" -gt 10 ]
then
left_cap $PS_DBG "$PS_LEFT_SLAB"
- if [ "$seconds" -lt 60 ]; then TZ='UTC' printf '%ds' "$seconds"
- elif [ "$seconds" -le 3600 ]; then TZ='UTC' printf '%(%Mm %Ss)T' "$seconds"
- elif [ "$seconds" -le 86400 ]; then TZ='UTC' printf '%(%Hh %Mm %Ss)T' "$seconds"
- else TZ='UTC' printf '%(%j %Hh %Mm %Ss)T' "$seconds" # Day of the year, starting from 001
+ if [ "$seconds" -lt 60 ]; then TZ='UTC+24' printf '%ds' "$seconds"
+ elif [ "$seconds" -le 3600 ]; then TZ='UTC+24' printf '%(%Mm %Ss)T' "$seconds"
+ elif [ "$seconds" -le 86400 ]; then TZ='UTC+24' printf '%(%Hh %Mm %Ss)T' "$seconds"
+ else TZ='UTC+24' printf '%(%j %Hh %Mm %Ss)T' "$seconds"
fi
right_cap $PS_DBG "$(right_slab dir)"
fi