def _from_ordinalf(x, tz=None):
 if (tz is None):
  tz = _get_rc_timezone()
 ix = int(x)
 dt = datetime.datetime.fromordinal(ix)
 remainder = (float(x) - ix)
 (hour, remainder) = divmod((24 * remainder), 1)
 (minute, remainder) = divmod((60 * remainder), 1)
 (second, remainder) = divmod((60 * remainder), 1)
 microsecond = int((1000000.0 * remainder))
 if (microsecond < 10):
  microsecond = 0
 dt = datetime.datetime(dt.year, dt.month, dt.day, int(hour), int(minute), int(second), microsecond, tzinfo=UTC).astimezone(tz)
 if (microsecond > 999990):
  dt += datetime.timedelta(microseconds=(1000000.0 - microsecond))
 return dt

def _from_ordinalf ( x , tz = None ) : if ( tz is None ) : tz = _get_rc_timezone ( ) ix = int ( x ) dt = datetime . datetime . fromordinal ( ix ) remainder = ( float ( x ) - ix ) ( hour , remainder ) = divmod ( ( 24 * remainder ) , 1 ) ( minute , remainder ) = divmod ( ( 60 * remainder ) , 1 ) ( second , remainder ) = divmod ( ( 60 * remainder ) , 1 ) microsecond = int ( ( 1000000.0 * remainder ) ) if ( microsecond < 10 ) : microsecond = 0 dt = datetime . datetime ( dt . year , dt . month , dt . day , int ( hour ) , int ( minute ) , int ( second ) , microsecond , tzinfo = UTC ) . astimezone ( tz ) if ( microsecond > 999990 ) : dt += datetime . timedelta ( microseconds = ( 1000000.0 - microsecond ) ) return dt
convert gregorian float of the date .