I cannot believe that this was as easy as it turned out to be. I had discussed this with Xeross a short while ago, but a tweet by Rettic reminded me about it this afternoon. I had wanted a way to show the year on my posts as the EVE year, and a simple little PHP script has done it for me.
So, the code:
<?php
$year = date('Y');
$month = date('m');
$day = date('d');
$year = $year - 1898;
$date = 'YC-' .$year. '-' .$month. '-' .$day;
echo $date
?>
The echo isn’t really needed here (for non PHP types echo just makes it print to screen), but wherever you want your date to show up replace it with that variable.
Now it is just a matter of editing the pages to put it in the proper place, which I haven’t gotten around to doing just yet, but will fairly soon.
Edit: Did a Theme Switch for proof of concept, as soon as I figure out how to get it to work with Mystique, I will switch it back. Damn Mystique…
Edit 2: As Rettic pointed out in the comments, Tumblr is a little bitch, but I have smacked that bitch into submission. JavaScript to do the same thing as the PHP above:
<script type=text/JavaScript>
var now = new Date();
now.getDate();
var year = now.getFullYear();
var year = year - 1898;
document.write("YC-" + year);
</script>
Just find the {Year} in your Tumblr theme and replace it with the script above.
Proof of concept: My Tumblr with its single post
Edit 3: It appears Rettic has dsicovered that all you need for Tumblr is:
<script type=text/javascript>
var year = {Year} - 1898;
document.write("YC-" + year);
</script>
To get it to work. Awesome job Rettic!
Pingback: Wordpress Blogs with YC years, the Function! (OOC)