A funny thing happened on the way to publish this website ...

That title did not turn out as well as I thought it might.

I don’t know if you’ve noticed yet, and honsetly I wasn’t going to mention it, but I’ve organized the pages on my site in a certain way: they are the numbered days of my life. I got the idea to number pages thus by trying to think of an easy way to increment and decrement URLs to use in my “yesterday” / “tomorrow” links (adding or subtracting one is way easier than figuring out the date, what month and year it’s in, etc.), and because my 10,000th day was just on December 10, 2017. So that’s how I built my website, and to make things easier on myself I installed dateutils and wrote a little script that, surprisingly, doesn’t use dateutils:

# lifeday [date]
# find out how many days old you are!  looks
# for BIRTHDAY env variable, if it doesn't
# find it, it uses my birthday.  the optional
# date is the day you want to calculate
# (defaults to today).  it'll accept whatever
# `date -d` does.

BIRTHDAY="${BIRTHDAY:-1990-07-25}"
TIMEZONE="${TIMEZONE:--6}"

today="${@:-today}"
now="$(date -d "${today}" +%s)"
birth="$(date -d "${BIRTHDAY}" +%s)"

tzadj="$((TIMEZONE * 60 * 60))"
# tzadj=0
dysec=86400 # 60 * 60 * 24

echo "$(( (now - birth + tzadj) / dysec ))"

You see that TIMEZONE line? That was written as TIMEZONE="${TIMEZONE:-6}" for quite a while, which knocked my whole date calculations off by 12 hours when writing posts, which means that most of my dates were off by a day. So I’ve had to adjust things.

So it’s all well and fine, but here’s the neat thing: it made me think about the arbitrary nature of dates. It doesn’t really matter what day I wrote x on, or when y happened. In fact, I was going to keep everything the same except for that the way the error happened meant the little script I’m using for writing new posts would be a day behind all the time. It doesn’t matter at all whether I wrote something on day 10065 or day 10064, just that it was written, I suppose.

I read something once saying the same thing about history: the dates don’t matter as much as the stories. So I guess this is me living that out, sort of.