JSFiddle - React, Tailwind, and code Playground
HTML
<!-- "fixing" http://xkcd.com/1340 by Rodrigo Hausen -->
<div class="xkcdcanvas" title="If our current civilization lasts another 8,000 years, it's probably fair to assume the Long Now Foundation got things right, and at some point we started listening to them and switched to five-digit years.">
<div id="xkcddate">2014-03-10!</div>
</div>
CSS
div#xkcddate {
color: #333;
text-shadow: 0px 0px 2px #ddd;
position: relative;
top: 30px;
text-align: center;
font-size: 16px;
font-family: xkcdregular, Sans;
}
/* image from http://xkcd.com/1340
* converted to base64 with
* http://webcodertools.com/imagetobase64converter
*/
div.xkcdcanvas {
width: 184px;
height: 333px;
background-image:...
JavaScript
var d = new Date();
var mon = d.getMonth() < 9 ? "0" + (d.getMonth() + 1) : d.getMonth() + 1;
var day = d.getDate() < 10 ? "0" + d.getDate() : d.getDate();
var str = d.getFullYear() + "-" + mon + "-" + day + "!";
document.getElementById("xkcddate").innerHTML = str;