hourFromDate func + improved initial algorithm