Upload files to "/"
This commit is contained in:
commit
d1a259b0e0
63
time.sh
Normal file
63
time.sh
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
#date
|
||||||
|
month=$(date +"%m")
|
||||||
|
dayofmonth=$(date +"%d")
|
||||||
|
year=$(date +"%Y")
|
||||||
|
if [ $((($year % 4))) == 0 ]; then
|
||||||
|
leapyear=1
|
||||||
|
elif [ $((($year % 4))) > 0 ]; then
|
||||||
|
leapyear=0
|
||||||
|
fi
|
||||||
|
totalday=0
|
||||||
|
if (( $month > 1 )); then
|
||||||
|
totalday=$((($totalday+31)));
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( $month > 2 )); then
|
||||||
|
totalday=$((($totalday+28+$leapyear))); # add value for leap year in february
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( $month > 3 )); then
|
||||||
|
totalday=$((($totalday+31)));
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( $month > 4 )); then
|
||||||
|
totalday=$((($totalday+30)));
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( $month > 5 )); then
|
||||||
|
totalday=$((($totalday+31)));
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( $month > 6 )); then
|
||||||
|
totalday=$((($totalday+30)));
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( $month > 7 )); then
|
||||||
|
totalday=$((($totalday+31)));
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( $month > 8 )); then
|
||||||
|
totalday=$((($totalday+31)));
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( $month > 9 )); then
|
||||||
|
totalday=$((($totalday+30)));
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( $month > 10 )); then
|
||||||
|
totalday=$((($totalday+31)));
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( $month > 11 )); then
|
||||||
|
totalday=$((($totalday+30)));
|
||||||
|
fi
|
||||||
|
totalday=$((($totalday+$dayofmonth)))
|
||||||
|
# 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
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user