code: def datetime2unix(T):
      
      T = atleast_1d(T)
  
      ut1_unix = empty(T.shape, dtype=float)
      for i, t in enumerate(T):
          if isinstance(t, (datetime, datetime64)):
              pass
          elif isinstance(t, str):
              try:
                  ut1_unix[i] = float(t)  # it was ut1_unix in a string
                  continue
              except ValueError:
                  t = parse(t)  # datetime in a string
          elif isinstance(t, (float, int)):  # assuming ALL are ut1_unix already
              return T
          else:
              raise TypeError('I only accept datetime or parseable date string')
  
          # ut1 seconds since unix epoch, need [] for error case
          ut1_unix[i] = forceutc(t).timestamp()
  
      return ut1_unix
docs: converts datetime to UT1 unix epoch time