def ut_datetime_to_mjd(<EOL>self,<EOL>utDatetime):
self.log.info('<STR_LIT>')<EOL>import time<EOL>import re<EOL>mjd = None<EOL>utDatetime = utDatetime.strip()<EOL>matchObject = re.match(<EOL>r'<STR_LIT>', utDatetime)<EOL>if not matchObject:<EOL><INDENT>self.log.error(<EOL>'<STR_LIT>' % locals())<EOL>raise IOError(<EOL>'<STR_LIT>' % locals())<EOL><DEDENT>year = matchObject.group("<STR_LIT>")<EOL>month = matchObject.group("<STR_LIT>")<EOL>day = matchObject.group("<STR_LIT>")<EOL>hours = matchObject.group("<STR_LIT>")<EOL>minutes = matchObject.group("<STR_LIT>")<EOL>seconds = matchObject.group("<STR_LIT>")<EOL>if "<STR_LIT:.>" in day:<EOL><INDENT>fhours = (float(day) - int(float(day))) * <NUM_LIT><EOL>hours = int(fhours)<EOL>fminutes = (fhours - hours) * <NUM_LIT><EOL>minutes = int(fminutes)<EOL>seconds = fhours - minutes<EOL>precision = len(repr(day).split("<STR_LIT:.>")[-<NUM_LIT:1>])<EOL><DEDENT>elif not hours:<EOL><INDENT>hours = "<STR_LIT>"<EOL>minutes = "<STR_LIT>"<EOL>seconds = "<STR_LIT>"<EOL>precision = <NUM_LIT:1><EOL><DEDENT>elif not seconds:<EOL><INDENT>seconds = "<STR_LIT>"<EOL>precision = <NUM_LIT:4><EOL><DEDENT>else:<EOL><INDENT>if "<STR_LIT:.>" not in seconds:<EOL><INDENT>precision = <NUM_LIT:5><EOL><DEDENT>else:<EOL><INDENT>decLen = len(seconds.split("<STR_LIT:.>")[-<NUM_LIT:1>])<EOL>precision = <NUM_LIT:5> + decLen<EOL><DEDENT><DEDENT>seconds = float(seconds)<EOL>year = float(year)<EOL>month = float(month)<EOL>day = float(day)<EOL>hours = float(hours)<EOL>minutes = float(minutes)<EOL>extraTime = <NUM_LIT:0.><EOL>if "<STR_LIT:.>" in repr(seconds):<EOL><INDENT>extraTime = float("<STR_LIT:.>" + repr(seconds).split("<STR_LIT:.>")<EOL>[-<NUM_LIT:1>]) / (<NUM_LIT> * <NUM_LIT> * <NUM_LIT>)<EOL><DEDENT>t = (int(year), int(month), int(day), int(hours),<EOL>int(minutes), int(seconds), <NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:0>)<EOL>unixtime = int(time.mktime(t))<EOL>mjd = (unixtime / <NUM_LIT> - <NUM_LIT> + <NUM_LIT>) + extraTime<EOL>mjd = "<STR_LIT>" % (precision, mjd)<EOL>self.log.info('<STR_LIT>')<EOL>return mjd<EOL>
*ut datetime to mjd*

        If the date given has no time associated with it (e.g. ``20160426``), then the datetime assumed is ``20160426 00:00:00.0``.

        Precision should be respected. 

        **Key Arguments:**
            - ``utDatetime`` -- UT datetime. Can accept various formats e.g. ``201604261444``, ``20160426``, ``20160426144444.5452``, ``2016-04-26 14:44:44.234``, ``20160426 14h44m44.432s`` 

        **Return:**
            - ``mjd`` -- the MJD

        .. todo ::

            - replace getMJDFromSqlDate in all code

        **Usage:**

            .. code-block:: python 

                from astrocalc.times import conversions
                converter = conversions(
                    log=log
                )
                mjd = converter.ut_datetime_to_mjd(utDatetime="20160426t1446")
                print mjd

                # OUT: 57504.6153

                mjd = converter.ut_datetime_to_mjd(utDatetime="2016-04-26 14:44:44.234")
                print mjd

                # OUT: 57504.61440