native_datetime_utc_now

Documentation for eth_defi.compat.native_datetime_utc_now function.

native_datetime_utc_now()

Get current UTC time as a native datetime object.

Replacement for the deprecated datetime.datetime.utcnow(). Returns a native datetime object (no timezone info) representing UTC time.

This is optimized for blockchain contexts where: - All timestamps are assumed to be UTC - Timezone-aware objects add unnecessary overhead - native datetimes are sufficient and faster

Returns:

datetime.datetime: Native datetime object in UTC

Return type

datetime.datetime