dissect.target.plugins.os.default.datetime

Module Contents

Classes

DateTimePlugin

Generic implementation for datetime plugin.

class dissect.target.plugins.os.default.datetime.DateTimePlugin(target: dissect.target.target.Target)

Bases: dissect.target.plugin.Plugin

Generic implementation for datetime plugin.

__namespace__ = 'datetime'

Defines the plugin namespace.

check_compatible() None

Perform a compatibility check with the target.

This function should return None if the plugin is compatible with the current target (self.target). For example, check if a certain file exists. Otherwise it should raise an UnsupportedPluginError.

Raises:

UnsupportedPluginError – If the plugin could not be loaded.

tz(name: str) datetime.tzinfo
tzinfo() datetime.tzinfo

Return a datetime.tzinfo of the current system timezone.

local(dt: datetime.datetime) datetime.datetime

Replace the tzinfo of a given datetime.datetime object with the current system tzinfo.

Does not perform any conversion.

to_utc(dt: datetime.datetime) datetime.datetime

Convert any datetime.datetime object into a UTC datetime.datetime object.

First replaces the current tzinfo with the system tzinfo without conversion, then converts it to an aware UTC datetime object.