Duck’s Timestamp Inserter

October 22nd, 2008

When writing up the Countdown Timer in Flash article yesterday, I stumbled across a need for a fairly simple plugin - one that would output the current Unix Timestamp into a Post's content. While I could use a plugin such as 'Exec-PHP' to accomplish this, that seemed to fall into the 'breaking eggs with a sledgehammer' brand of overkill.

As such, I whipped up a quick Wordpress plugin (as I often do for these tiny problems), and decided to make this one available to the public. So without further ado, I give you...

Duck's Timestamp Inserter! Ok, it could use a more creative title. Using some pretty simple markup, it allows me to insert the current timestamp, or offsets thereof, into my post content.

<!--ducktime--> becomes 1268360706, while <!--ducktime+5000--> becomes 1268365706 and <!--ducktime-1200--> becomes 1268359506. If you refresh the page, you'll see these all change.

UPDATE: This Plugin is now listed on the WordPress Plugin Repository! You can download Duck's Timestamp Inserter from there - and of course, Ratings are appreciated. I've released it under GPL3. If you find it useful, please consider Donating.

 

Musings on Coding, Gaming, and Life in General
Loading...