Programmer’s day that is not

Well I don’t feel much like a programmer, but writing this was proposed by my laziness. Anyway it’s good opportunity to write small code that could be actually useful:

function getYearDay():int {
var n:int = 0;
var td:Date = new Date();
var d:Date = new Date (td.getFullYear(), 0, 1);
while ( d.getTime() < td.getTime() ) {
d.setDate( d.getDate() + 1 );
++n;
}
return n;
}
if ( getYearDay() != 2 >> 8 ) {
trace(“WTF?!”);
}

getYearDay() function was highly based on this stuff by tvmiller

Another thing around this is Wikipedia article or rather lack of it. It was deleted by some Wikipedia Nazis ;] Read the discussion. I have no idea why they are so pushy towards deleting it since, as someone mentioned, there is place on Wikipedia for such things as Pi Day, Mole Day, Square root day, Towel Day, System Administrator Appreciation Day.

Anyway I better get back to work.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.