… calculate the number of seconds in the current year using JavaScript:
function seconds_in_this_year() { // get length of this year by subtracting "Jan 1st, /This Year/" // from "Jan 1st, /Next Year/" var now = new Date(); var current_year = now.getFullYear(); var jan_first = new Date(current_year, 0, 1, 0, 0, 0, 0); var jan_next = new Date(current_year + 1, 0, 1, 0, 0, 0, 0); return (jan_next.getTime() - jan_first.getTime()) / 1000; }
While you’re on the topic of esoterica, got any suggestions for someone who’s about to have to wade into Perl again after a multi-year absence?
Sounds like my next task will involve writing some scripts, and I haven’t touched the camel for a good, oh, six years.
“Touched the camel.” *shudders*
You need the Perl Cookbook – http://www.amazon.com/exec/obidos/tg/detail/-/1565922433/
Oops, make that http://www.amazon.com/exec/obidos/tg/detail/-/0596003137/