:py:mod:`dissect.target.plugins.os.default.datetime` ==================================================== .. py:module:: dissect.target.plugins.os.default.datetime Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.target.plugins.os.default.datetime.DateTimePlugin .. py:class:: DateTimePlugin(target: dissect.target.target.Target) Bases: :py:obj:`dissect.target.plugin.Plugin` Generic implementation for datetime plugin. .. py:attribute:: __namespace__ :value: 'datetime' Defines the plugin namespace. .. py:method:: 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 :class:`UnsupportedPluginError`. :raises UnsupportedPluginError: If the plugin could not be loaded. .. py:method:: tz(name: str) -> datetime.tzinfo .. py:method:: tzinfo() -> datetime.tzinfo Return a ``datetime.tzinfo`` of the current system timezone. .. py:method:: 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. .. py:method:: 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.