def datetime2unix(T):
T = atleast_1d(T)<EOL>ut1_unix = empty(T.shape, dtype=float)<EOL>for i, t in enumerate(T):<EOL><INDENT>if isinstance(t, (datetime, datetime64)):<EOL><INDENT>pass<EOL><DEDENT>elif isinstance(t, str):<EOL><INDENT>try:<EOL><INDENT>ut1_unix[i] = float(t)  <EOL>continue<EOL><DEDENT>except ValueError:<EOL><INDENT>t = parse(t)  <EOL><DEDENT><DEDENT>elif isinstance(t, (float, int)):  <EOL><INDENT>return T<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>ut1_unix[i] = forceutc(t).timestamp()<EOL><DEDENT>return ut1_unix<EOL>
converts datetime to UT1 unix epoch time