diff --git a/config/dpkg/changelog b/config/dpkg/changelog index 2faad3fd..6b9ce783 100644 --- a/config/dpkg/changelog +++ b/config/dpkg/changelog @@ -1,5 +1,5 @@ -dfvfs (20231208-1) unstable; urgency=low +dfvfs (20231229-1) unstable; urgency=low * Auto-generated - -- Log2Timeline maintainers Fri, 08 Dec 2023 06:59:06 +0100 + -- Log2Timeline maintainers Fri, 29 Dec 2023 05:50:02 +0100 diff --git a/dfvfs/__init__.py b/dfvfs/__init__.py index 026dae40..65b687c7 100644 --- a/dfvfs/__init__.py +++ b/dfvfs/__init__.py @@ -6,4 +6,4 @@ storage media types and file formats. """ -__version__ = '20231208' +__version__ = '20231229' diff --git a/dfvfs/vfs/tsk_file_entry.py b/dfvfs/vfs/tsk_file_entry.py index dc6c48be..65183552 100644 --- a/dfvfs/vfs/tsk_file_entry.py +++ b/dfvfs/vfs/tsk_file_entry.py @@ -104,7 +104,7 @@ def CopyFromDateTimeString(self, time_string): YYYY-MM-DD hh:mm:ss.######[+-]##:## Where # are numeric digits ranging from 0 to 9 and the seconds - fraction can be either 3 or 6 digits. The time of day, seconds + fraction can be either 3, 6 or 9 digits. The time of day, seconds fraction and time zone offset are optional. The default time zone is UTC. """ @@ -116,18 +116,20 @@ def CopyFromDateTimeString(self, time_string): hours = date_time_values.get('hours', 0) minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) - microseconds = date_time_values.get('microseconds', 0) + nanoseconds = date_time_values.get('nanoseconds', None) time_zone_offset = date_time_values.get('time_zone_offset', 0) self._timestamp = self._GetNumberOfSecondsFromElements( year, month, day_of_month, hours, minutes, seconds) - self.fraction_of_second = microseconds - self._time_zone_offset = time_zone_offset - if pytsk3.TSK_VERSION_NUM >= 0x040200ff: - self.fraction_of_second *= 1000 + if nanoseconds is not None: + self.fraction_of_second = nanoseconds else: - self.fraction_of_second *= 10 + # TODO: kept for backwards compatibility with older dfdatetime versions. + self.fraction_of_second = date_time_values.get('microseconds', 0) * 1000 + + self._precision = dfdatetime_definitions.PRECISION_1_NANOSECOND + self._time_zone_offset = time_zone_offset self._normalized_timestamp = None self.is_local_time = False @@ -153,7 +155,7 @@ def CopyToDateTimeString(self): return (f'{year:04d}-{month:02d}-{day_of_month:02d} ' f'{hours:02d}:{minutes:02d}:{seconds:02d}') - if pytsk3.TSK_VERSION_NUM >= 0x040200ff: + if self._precision == dfdatetime_definitions.PRECISION_1_NANOSECOND: return (f'{year:04d}-{month:02d}-{day_of_month:02d} ' f'{hours:02d}:{minutes:02d}:{seconds:02d}' f'.{self.fraction_of_second:09d}') diff --git a/setup.cfg b/setup.cfg index 2fa20da1..5bc528cd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = dfvfs -version = 20231227 +version = 20231229 description = Digital Forensics Virtual File System (dfVFS). long_description = dfVFS, or Digital Forensics Virtual File System, provides read-only access to file-system objects from various storage media types and file formats. The goal of dfVFS is to provide a generic interface for accessing file-system objects, for which it uses several back-ends that provide the actual implementation of the various storage media types, volume systems and file systems. long_description_content_type = text/plain