@classmethod<EOL><INDENT>def fromDateTime(cls, dt):<DEDENT>
text = dt.strftime(cls._yearsDigits == <NUM_LIT:4> and '<STR_LIT>' or '<STR_LIT>')<EOL>if cls._hasSubsecond:<EOL><INDENT>text += '<STR_LIT>' % (dt.microsecond // <NUM_LIT:1000>)<EOL><DEDENT>if dt.utcoffset():<EOL><INDENT>seconds = dt.utcoffset().seconds<EOL>if seconds < <NUM_LIT:0>:<EOL><INDENT>text += '<STR_LIT:->'<EOL><DEDENT>else:<EOL><INDENT>text += '<STR_LIT:+>'<EOL><DEDENT>text += '<STR_LIT>' % (seconds // <NUM_LIT>, seconds % <NUM_LIT>)<EOL><DEDENT>else:<EOL><INDENT>text += '<STR_LIT>'<EOL><DEDENT>return cls(text)<EOL>
Create |ASN.1| object from a :py:class:`datetime.datetime` object.

        Parameters
        ----------
        dt: :py:class:`datetime.datetime` object
            The `datetime.datetime` object to initialize the |ASN.1| object
            from

        Returns
        -------
        :
            new instance of |ASN.1| value