🔧 Updated btime script, more efficient

This commit is contained in:
z3rOR0ne 2024-11-27 22:49:57 -08:00
parent 49085c5bda
commit bd038049c0
2 changed files with 14 additions and 1 deletions

14
scripts/btime Executable file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
main() {
hour=$(date +%H)
if ((hour >= 12 && hour < 16)); then
printf "%s AM\n" "$(date '+%I:%M:%S')"
elif ((hour >= 16 || hour <= 23)); then
printf "%s PM\n" "$(date '+%I:%M:%S')"
else
echo "Invalid hour. Please check your system clock."
fi
}
main