dot

packages and services management
Log | Files | Refs | README

commit 7d6e00ddeeac5e6924ef80730da8eafbe0184345
parent 4f7f5a7e44e446c557216524e0fdab8bbad2b577
Author: Josuah Demangeon <mail@josuah.net>
Date:   Tue, 26 Dec 2017 20:36:51 +0100

fixed date based off agenda

Diffstat:
Mbin/twt | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/twt b/bin/twt @@ -6,7 +6,7 @@ FEED=$HOME/srv/twtxt.txt CONF=$HOME/.config/twt CACHE=$HOME/.cache/twt -awk_date=' +awk_line=' function leap(yrs) { return (yrs % 4 == 0) && (yrs % 100 != 0) || (yrs % 400 == 0); @@ -22,11 +22,11 @@ function days_per_month(mth, yrs) function to_sec(yrs, mth, day, hrs, min, sec) { - for (mth--; mth > 0; mth--) + while (--mth >= 1) day += days_per_month(mth, yrs); - for (yrs--; yrs >= 1970; yrs--) + while (--yrs >= 1970) day += 365 + leap(yrs); - return sec + 60 * (min + 60 * (hrs + (24 * day))); + return (((((day - 1) * 24) + hrs) * 60) + min) * 60 + sec; } function to_date(fmt, sec)