code: def juliandate(time: datetime) -> float:
      
  
      times = np.atleast_1d(time)
      assert times.ndim == 1
  
      jd = np.empty(times.size)
      for i, t in enumerate(times):
          if t.month < 3:
              year = t.year - 1
              month = t.month + 12
          else:
              year = t.year
              month = t.month
  
          A = int(year / 100.0)
          B = 2 - A + int(A / 4.)
          C = ((t.second / 60. + t.minute) / 60. + t.hour) / 24.
  
          jd[i] = (int(365.25 * (year + 4716)) +
                   int(30.6001 * (month + 1)) + t.day + B - 1524.5 + C)
  
      return jd.squeeze()
docs: Python datetime to Julian time
  
      from D.Vallado Fundamentals of Astrodynamics and Applications p.187
       and J. Meeus Astronomical Algorithms 1991 Eqn. 7.1 pg. 61
  
      Parameters
      ----------
  
      time : datetime.datetime
          time to convert
  
      Results
      -------
  
      jd : float
          Julian date