get the day of year because javascript has no tm_yday