def dehydrate_datetime(value):
def seconds_and_nanoseconds(dt):<EOL><INDENT>if isinstance(dt, datetime):<EOL><INDENT>dt = DateTime.from_native(dt)<EOL><DEDENT>zone_epoch = DateTime(<NUM_LIT>, <NUM_LIT:1>, <NUM_LIT:1>, tzinfo=dt.tzinfo)<EOL>t = dt.to_clock_time() - zone_epoch.to_clock_time()<EOL>return t.seconds, t.nanoseconds<EOL><DEDENT>tz = value.tzinfo<EOL>if tz is None:<EOL><INDENT>value = utc.localize(value)<EOL>seconds, nanoseconds = seconds_and_nanoseconds(value)<EOL>return Structure(b"<STR_LIT:d>", seconds, nanoseconds)<EOL><DEDENT>elif hasattr(tz, "<STR_LIT>") and tz.zone:<EOL><INDENT>seconds, nanoseconds = seconds_and_nanoseconds(value)<EOL>return Structure(b"<STR_LIT:f>", seconds, nanoseconds, tz.zone)<EOL><DEDENT>else:<EOL><INDENT>seconds, nanoseconds = seconds_and_nanoseconds(value)<EOL>return Structure(b"<STR_LIT:F>", seconds, nanoseconds, tz.utcoffset(value).seconds)<EOL><DEDENT>
Dehydrator for `datetime` values.

    :param value:
    :type value: datetime
    :return: