WordPressIf you scroll to the bottom of this page, you’ll see that in my footer I display how long I’ve been publishing this site. It’s pretty simple to do this; all you really need is the DateDiff plugin and PHP’s default date() function.


Once you’ve installed DateDiff, just add this code to your footer.php template:

This blog has been online for <?php datediff("2000-3-14","now","y"); ?> years, <?php datediff("2000-3-14","now","ym"); ?> months, and <?php datediff("2000-3-14","now","md"); ?> days.
I have now been blogging here for <? datediff("2000-3-14", date("Y-m-d"), "d"); ?> days.

In case it’s not obvious, you’ll need to replace the “2000-3-14” with the actual date that you started blogging.

Post the first comment:

I'll never share your email address and it won't be published.

What Is This?

davidgagne.net is the personal weblog of me, David Vincent Gagne. I've been publishing here since 1999, which makes this one of the oldest continuously-updated websites on the Internet.

bartender.live

A few years ago I was trying to determine what cocktails I could make with the alcohol I had at home. I searched the App Store but couldn't find an app that would let me do that, so I built one.

Hemingway

You can read dozens of essays and articles and find hundreds of links to other sites with stories and information about Ernest Hemingway in The Hemingway Collection.