sus
This commit is contained in:
parent
fd574c6a7d
commit
8c020280dc
@ -28,7 +28,7 @@ while (len(sys.argv) > 1):
|
||||
|
||||
# Printing
|
||||
print(f" {year_hex}")
|
||||
print("Prim Seco Tert Quad Quin Sext Sept Octo")
|
||||
print("Prim Seco Tert Quat Quin Sena Sept Octo")
|
||||
|
||||
day_of_week_start = start_day % 8
|
||||
for x in range(day_of_week_start-1):
|
||||
@ -50,5 +50,5 @@ for x in range(start_day, end_day):
|
||||
if (octal_counter % 8 == 0):
|
||||
print("")
|
||||
|
||||
print("\nPrim Seco Tert Quad Quin Sext Sept Octo")
|
||||
print("\nPrim Seco Tert Quad Quin Sena Sept Octo")
|
||||
print(f" {year_hex}")
|
||||
|
29
time.sh
Normal file → Executable file
29
time.sh
Normal file → Executable file
@ -1,10 +1,17 @@
|
||||
if [ "$1" = "--help" ]; then
|
||||
echo " + '
|
||||
\$span = span
|
||||
\$day = day
|
||||
\$year = year
|
||||
time.sh + '%span %day/%year'"
|
||||
fi
|
||||
#date
|
||||
month=$(date +"%m")
|
||||
dayofmonth=$(date +"%d")
|
||||
year=$(date +"%Y")
|
||||
if [ $((($year % 4))) == 0 ]; then
|
||||
year_den=$(date +"%Y")
|
||||
if [ $((($year_den % 4))) == 0 ]; then
|
||||
leapyear=1
|
||||
elif [ $((($year % 4))) > 0 ]; then
|
||||
elif [ $((($year_den % 4))) > 0 ]; then
|
||||
leapyear=0
|
||||
fi
|
||||
totalday=0
|
||||
@ -51,13 +58,23 @@ fi
|
||||
if (( $month > 11 )); then
|
||||
totalday=$((($totalday+30)));
|
||||
fi
|
||||
totalday=$((($totalday+$dayofmonth)))
|
||||
day_den=$(((10#$totalday+10#$dayofmonth)))
|
||||
day_hex=$(printf "%x\n" $totalday)
|
||||
# Time
|
||||
second=$(date +"%S")
|
||||
minute=$(date +"%M")
|
||||
hour=$(date +"%H")
|
||||
nanosecond=$(date +"%N")
|
||||
second_of_the_day=$(bc -l <<< "($hour * 3600) + ($minute * 60) + $second")
|
||||
span_of_the_day=$(bc -l <<< "$second_of_the_day * 0.864")
|
||||
echo $span_of_the_day $totalday/$year
|
||||
span_den=$(bc -l <<< "$second_of_the_day / (86400/65536)")
|
||||
span_den=$(echo $span_den | awk '{printf("%d\n",$1 + 0.5)}' )
|
||||
span_hex=$(printf "%x\n" $span_den)
|
||||
year_hex=$(printf "%x\n" $year_den)
|
||||
|
||||
if [ "$1" = "--den" ]; then
|
||||
echo $span_den $day_den/$year_den
|
||||
elif [ "$1" = "--hex" ]; then
|
||||
echo $span_hex $day_hex/$year_hex
|
||||
else
|
||||
echo "specify hex or den with --hex or --den"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user