From f9247c69df48cbde2946d14c8e59bdf154cec6b3 Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Fri, 23 Feb 2024 18:55:24 +0100 Subject: [PATCH] Do not set undefined time zone for copy from string (#277) --- .github/workflows/test_docker.yml | 2 +- config/dpkg/changelog | 4 +-- dfdatetime/__init__.py | 2 +- dfdatetime/cocoa_time.py | 2 +- dfdatetime/delphi_date_time.py | 2 +- dfdatetime/dotnet_datetime.py | 2 +- dfdatetime/fake_time.py | 2 +- dfdatetime/fat_date_time.py | 4 +-- dfdatetime/filetime.py | 2 +- dfdatetime/golang_time.py | 2 +- dfdatetime/hfs_time.py | 2 +- dfdatetime/ole_automation_date.py | 2 +- dfdatetime/posix_time.py | 8 ++--- dfdatetime/rfc2579_date_time.py | 2 +- dfdatetime/systemtime.py | 2 +- dfdatetime/time_elements.py | 4 +-- dfdatetime/uuid_time.py | 2 +- dfdatetime/webkit_time.py | 2 +- docs/sources/Date-and-time-values.md | 3 +- setup.cfg | 2 +- tests/cocoa_time.py | 8 ++--- tests/delphi_date_time.py | 8 ++--- tests/dotnet_datetime.py | 6 ++-- tests/fake_time.py | 8 ++--- tests/fat_date_time.py | 16 ++++----- tests/filetime.py | 8 ++--- tests/golang_time.py | 10 +++--- tests/hfs_time.py | 8 ++--- tests/java_time.py | 8 ++--- tests/ole_automation_date.py | 8 ++--- tests/posix_time.py | 32 ++++++++--------- tests/rfc2579_date_time.py | 8 ++--- tests/systemtime.py | 8 ++--- tests/time_elements.py | 54 ++++++++++++++-------------- tests/uuid_time.py | 8 ++--- tests/webkit_time.py | 8 ++--- 36 files changed, 129 insertions(+), 130 deletions(-) diff --git a/.github/workflows/test_docker.yml b/.github/workflows/test_docker.yml index b365c03..fe6b4f3 100644 --- a/.github/workflows/test_docker.yml +++ b/.github/workflows/test_docker.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: ['38'] + version: ['39'] container: image: registry.fedoraproject.org/fedora:${{ matrix.version }} steps: diff --git a/config/dpkg/changelog b/config/dpkg/changelog index d76cf34..9944e2e 100644 --- a/config/dpkg/changelog +++ b/config/dpkg/changelog @@ -1,5 +1,5 @@ -dfdatetime (20240210-1) unstable; urgency=low +dfdatetime (20240220-1) unstable; urgency=low * Auto-generated - -- Log2Timeline maintainers Sat, 10 Feb 2024 07:26:17 +0100 + -- Log2Timeline maintainers Tue, 20 Feb 2024 19:10:25 +0100 diff --git a/dfdatetime/__init__.py b/dfdatetime/__init__.py index 1037e7d..9454481 100644 --- a/dfdatetime/__init__.py +++ b/dfdatetime/__init__.py @@ -25,4 +25,4 @@ from dfdatetime import webkit_time -__version__ = '20240210' +__version__ = '20240220' diff --git a/dfdatetime/cocoa_time.py b/dfdatetime/cocoa_time.py index 17cb853..986554e 100644 --- a/dfdatetime/cocoa_time.py +++ b/dfdatetime/cocoa_time.py @@ -94,7 +94,7 @@ def CopyFromDateTimeString(self, time_string): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) timestamp = self._GetNumberOfSecondsFromElements( year, month, day_of_month, hours, minutes, seconds) diff --git a/dfdatetime/delphi_date_time.py b/dfdatetime/delphi_date_time.py index 5d23308..27ceb33 100644 --- a/dfdatetime/delphi_date_time.py +++ b/dfdatetime/delphi_date_time.py @@ -99,7 +99,7 @@ def CopyFromDateTimeString(self, time_string): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) if year > 9999: raise ValueError(f'Unsupported year value: {year:d}.') diff --git a/dfdatetime/dotnet_datetime.py b/dfdatetime/dotnet_datetime.py index cf824eb..b31fc50 100644 --- a/dfdatetime/dotnet_datetime.py +++ b/dfdatetime/dotnet_datetime.py @@ -95,7 +95,7 @@ def CopyFromDateTimeString(self, time_string): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) if year > 9999: raise ValueError(f'Unsupported year value: {year:d}.') diff --git a/dfdatetime/fake_time.py b/dfdatetime/fake_time.py index d65133f..0003243 100644 --- a/dfdatetime/fake_time.py +++ b/dfdatetime/fake_time.py @@ -82,7 +82,7 @@ def CopyFromDateTimeString(self, time_string): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', None) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) self._normalized_timestamp = None self._number_of_seconds = self._GetNumberOfSecondsFromElements( diff --git a/dfdatetime/fat_date_time.py b/dfdatetime/fat_date_time.py index 76c9494..1158c64 100644 --- a/dfdatetime/fat_date_time.py +++ b/dfdatetime/fat_date_time.py @@ -155,7 +155,7 @@ 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) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) if year < 1980 or year > (1980 + 0x7f): raise ValueError(f'Year value not supported: {year!s}.') @@ -266,7 +266,7 @@ def CopyFromDateTimeString(self, time_string): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) if year < 1980 or year > (1980 + 0x7f): raise ValueError(f'Year value not supported: {year!s}.') diff --git a/dfdatetime/filetime.py b/dfdatetime/filetime.py index 3fc6127..6a9c358 100644 --- a/dfdatetime/filetime.py +++ b/dfdatetime/filetime.py @@ -99,7 +99,7 @@ def CopyFromDateTimeString(self, time_string): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) if year < 1601: raise ValueError(f'Year value not supported: {year!s}.') diff --git a/dfdatetime/golang_time.py b/dfdatetime/golang_time.py index 54346d8..7fa0d26 100644 --- a/dfdatetime/golang_time.py +++ b/dfdatetime/golang_time.py @@ -176,7 +176,7 @@ def CopyFromDateTimeString(self, time_string): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) if year < 0: raise ValueError(f'Year value not supported: {year!s}.') diff --git a/dfdatetime/hfs_time.py b/dfdatetime/hfs_time.py index c817c42..4a2d194 100644 --- a/dfdatetime/hfs_time.py +++ b/dfdatetime/hfs_time.py @@ -95,7 +95,7 @@ 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) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) if year < 1904 or year > 2040: raise ValueError('Year value not supported.') diff --git a/dfdatetime/ole_automation_date.py b/dfdatetime/ole_automation_date.py index 22602b8..3cd59f6 100644 --- a/dfdatetime/ole_automation_date.py +++ b/dfdatetime/ole_automation_date.py @@ -100,7 +100,7 @@ def CopyFromDateTimeString(self, time_string): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) timestamp = self._GetNumberOfSecondsFromElements( year, month, day_of_month, hours, minutes, seconds) diff --git a/dfdatetime/posix_time.py b/dfdatetime/posix_time.py index d446bb4..6d133d4 100644 --- a/dfdatetime/posix_time.py +++ b/dfdatetime/posix_time.py @@ -90,7 +90,7 @@ 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) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) self._timestamp = self._GetNumberOfSecondsFromElements( year, month, day_of_month, hours, minutes, seconds) @@ -188,7 +188,7 @@ def CopyFromDateTimeString(self, time_string): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) milliseconds, _ = divmod( nanoseconds, definitions.NANOSECONDS_PER_MILLISECOND) @@ -294,7 +294,7 @@ def CopyFromDateTimeString(self, time_string): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) milliseconds, _ = divmod( nanoseconds, definitions.NANOSECONDS_PER_MICROSECOND) @@ -400,7 +400,7 @@ def _CopyFromDateTimeString(self, time_string): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) timestamp = self._GetNumberOfSecondsFromElements( year, month, day_of_month, hours, minutes, seconds) diff --git a/dfdatetime/rfc2579_date_time.py b/dfdatetime/rfc2579_date_time.py index d137466..ee4c8f2 100644 --- a/dfdatetime/rfc2579_date_time.py +++ b/dfdatetime/rfc2579_date_time.py @@ -209,7 +209,7 @@ def CopyFromDateTimeString(self, time_string): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) deciseconds, _ = divmod( nanoseconds, definitions.NANOSECONDS_PER_DECISECOND) diff --git a/dfdatetime/systemtime.py b/dfdatetime/systemtime.py index 6de82d3..2840171 100644 --- a/dfdatetime/systemtime.py +++ b/dfdatetime/systemtime.py @@ -184,7 +184,7 @@ def CopyFromDateTimeString(self, time_string): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) milliseconds, _ = divmod( nanoseconds, definitions.NANOSECONDS_PER_MILLISECOND) diff --git a/dfdatetime/time_elements.py b/dfdatetime/time_elements.py index b9a3f0c..e12175b 100644 --- a/dfdatetime/time_elements.py +++ b/dfdatetime/time_elements.py @@ -358,7 +358,7 @@ def _CopyFromDateTimeValues(self, date_time_values): hours = date_time_values.get('hours', 0) minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) self._normalized_timestamp = None self._number_of_seconds = self._GetNumberOfSecondsFromElements( @@ -954,7 +954,7 @@ def _CopyFromDateTimeValues(self, date_time_values): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) precision_helper = precisions.PrecisionHelperFactory.CreatePrecisionHelper( self._precision) diff --git a/dfdatetime/uuid_time.py b/dfdatetime/uuid_time.py index 0c7eb17..a41e9d8 100644 --- a/dfdatetime/uuid_time.py +++ b/dfdatetime/uuid_time.py @@ -105,7 +105,7 @@ def CopyFromDateTimeString(self, time_string): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) if year < 1582: raise ValueError('Year value not supported.') diff --git a/dfdatetime/webkit_time.py b/dfdatetime/webkit_time.py index ac37a82..099f0f2 100644 --- a/dfdatetime/webkit_time.py +++ b/dfdatetime/webkit_time.py @@ -96,7 +96,7 @@ def CopyFromDateTimeString(self, time_string): minutes = date_time_values.get('minutes', 0) seconds = date_time_values.get('seconds', 0) nanoseconds = date_time_values.get('nanoseconds', 0) - time_zone_offset = date_time_values.get('time_zone_offset', 0) + time_zone_offset = date_time_values.get('time_zone_offset', None) microseconds, _ = divmod( nanoseconds, definitions.NANOSECONDS_PER_MICROSECOND) diff --git a/docs/sources/Date-and-time-values.md b/docs/sources/Date-and-time-values.md index ca8d339..d8ad737 100644 --- a/docs/sources/Date-and-time-values.md +++ b/docs/sources/Date-and-time-values.md @@ -205,8 +205,7 @@ Supported date range | 1601-01-01 00:00:00.0000000 through ... Storage granularity | 100-nanosecond intervals Time zone | externally represented, typically UTC -The actual upper bound of the supported date range is unclear. Also see: -[Latest possible FILETIME](https://stackoverflow.com/questions/9999393/latest-possible-filetime) +The actual upper bound of the supported date range is unclear. ### Format diff --git a/setup.cfg b/setup.cfg index c5bc47e..c07ba41 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = dfdatetime -version = 20240210 +version = 20240220 description = Digital Forensics date and time (dfDateTime). long_description = dfDateTime, or Digital Forensics date and time, provides date and time objects to preserve accuracy and precision. long_description_content_type = text/plain diff --git a/tests/cocoa_time.py b/tests/cocoa_time.py index 9098f63..4b8252a 100644 --- a/tests/cocoa_time.py +++ b/tests/cocoa_time.py @@ -60,15 +60,15 @@ def testCopyFromDateTimeString(self): cocoa_time_object.CopyFromDateTimeString('2013-07-08') self.assertEqual(cocoa_time_object._timestamp, 394934400.0) - self.assertEqual(cocoa_time_object._time_zone_offset, 0) + self.assertEqual(cocoa_time_object._time_zone_offset, None) cocoa_time_object.CopyFromDateTimeString('2013-07-08 21:30:45') self.assertEqual(cocoa_time_object._timestamp, 395011845.0) - self.assertEqual(cocoa_time_object._time_zone_offset, 0) + self.assertEqual(cocoa_time_object._time_zone_offset, None) cocoa_time_object.CopyFromDateTimeString('2013-07-08 21:30:45.546875') self.assertEqual(cocoa_time_object._timestamp, 395011845.546875) - self.assertEqual(cocoa_time_object._time_zone_offset, 0) + self.assertEqual(cocoa_time_object._time_zone_offset, None) cocoa_time_object.CopyFromDateTimeString('2013-07-08 21:30:45.546875-01:00') self.assertEqual(cocoa_time_object._timestamp, 395011845.546875) @@ -80,7 +80,7 @@ def testCopyFromDateTimeString(self): cocoa_time_object.CopyFromDateTimeString('2001-01-02 00:00:00') self.assertEqual(cocoa_time_object._timestamp, 86400.0) - self.assertEqual(cocoa_time_object._time_zone_offset, 0) + self.assertEqual(cocoa_time_object._time_zone_offset, None) def testCopyToDateTimeString(self): """Tests the CopyToDateTimeString function.""" diff --git a/tests/delphi_date_time.py b/tests/delphi_date_time.py index 79d6074..59b84ce 100644 --- a/tests/delphi_date_time.py +++ b/tests/delphi_date_time.py @@ -100,15 +100,15 @@ def testCopyFromDateTimeString(self): delphi_date_time_object.CopyFromDateTimeString('2013-06-18') self.assertEqual(delphi_date_time_object._timestamp, 41443.0) - self.assertEqual(delphi_date_time_object._time_zone_offset, 0) + self.assertEqual(delphi_date_time_object._time_zone_offset, None) delphi_date_time_object.CopyFromDateTimeString('2013-06-18 19:50:00') self.assertEqual(delphi_date_time_object._timestamp, 41443.82638888889) - self.assertEqual(delphi_date_time_object._time_zone_offset, 0) + self.assertEqual(delphi_date_time_object._time_zone_offset, None) delphi_date_time_object.CopyFromDateTimeString('2013-06-18 19:50:00.546875') self.assertEqual(delphi_date_time_object._timestamp, 41443.826395218464) - self.assertEqual(delphi_date_time_object._time_zone_offset, 0) + self.assertEqual(delphi_date_time_object._time_zone_offset, None) delphi_date_time_object.CopyFromDateTimeString( '2013-06-18 19:50:00.546875-01:00') @@ -122,7 +122,7 @@ def testCopyFromDateTimeString(self): delphi_date_time_object.CopyFromDateTimeString('1899-12-31 00:00:00') self.assertEqual(delphi_date_time_object._timestamp, 1.0) - self.assertEqual(delphi_date_time_object._time_zone_offset, 0) + self.assertEqual(delphi_date_time_object._time_zone_offset, None) delphi_date_time_object = DelphiDateTimeInvalidYear() diff --git a/tests/dotnet_datetime.py b/tests/dotnet_datetime.py index 031505b..4ae1256 100644 --- a/tests/dotnet_datetime.py +++ b/tests/dotnet_datetime.py @@ -64,15 +64,15 @@ def testCopyFromDateTimeString(self): dotnet_date_time.CopyFromDateTimeString('2020-12-12') self.assertEqual(dotnet_date_time._timestamp, 637433280000000000) - self.assertEqual(dotnet_date_time._time_zone_offset, 0) + self.assertEqual(dotnet_date_time._time_zone_offset, None) dotnet_date_time.CopyFromDateTimeString('2020-12-12 12:12:12') self.assertEqual(dotnet_date_time._timestamp, 637433719320000000) - self.assertEqual(dotnet_date_time._time_zone_offset, 0) + self.assertEqual(dotnet_date_time._time_zone_offset, None) dotnet_date_time.CopyFromDateTimeString('2020-12-12 12:12:12.123') self.assertEqual(dotnet_date_time._timestamp, 637433719321230000) - self.assertEqual(dotnet_date_time._time_zone_offset, 0) + self.assertEqual(dotnet_date_time._time_zone_offset, None) def testCopyToDateTimeString(self): """Tests the CopyToDateTimeString function.""" diff --git a/tests/fake_time.py b/tests/fake_time.py index 19a2de8..abccf8e 100644 --- a/tests/fake_time.py +++ b/tests/fake_time.py @@ -55,17 +55,17 @@ def testCopyFromDateTimeString(self): fake_time_object.CopyFromDateTimeString('2010-08-12') self.assertEqual(fake_time_object._number_of_seconds, 1281571200) self.assertIsNone(fake_time_object._microseconds) - self.assertEqual(fake_time_object._time_zone_offset, 0) + self.assertEqual(fake_time_object._time_zone_offset, None) fake_time_object.CopyFromDateTimeString('2010-08-12 21:06:31') self.assertEqual(fake_time_object._number_of_seconds, 1281647191) self.assertIsNone(fake_time_object._microseconds) - self.assertEqual(fake_time_object._time_zone_offset, 0) + self.assertEqual(fake_time_object._time_zone_offset, None) fake_time_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875') self.assertEqual(fake_time_object._number_of_seconds, 1281647191) self.assertEqual(fake_time_object._microseconds, 546875) - self.assertEqual(fake_time_object._time_zone_offset, 0) + self.assertEqual(fake_time_object._time_zone_offset, None) fake_time_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875-01:00') self.assertEqual(fake_time_object._number_of_seconds, 1281647191) @@ -80,7 +80,7 @@ def testCopyFromDateTimeString(self): fake_time_object.CopyFromDateTimeString('1601-01-02 00:00:00') self.assertEqual(fake_time_object._number_of_seconds, -11644387200) self.assertIsNone(fake_time_object._microseconds) - self.assertEqual(fake_time_object._time_zone_offset, 0) + self.assertEqual(fake_time_object._time_zone_offset, None) def testCopyToDateTimeString(self): """Tests the CopyToDateTimeString function.""" diff --git a/tests/fat_date_time.py b/tests/fat_date_time.py index 60fa38e..e4014c2 100644 --- a/tests/fat_date_time.py +++ b/tests/fat_date_time.py @@ -52,15 +52,15 @@ def testCopyFromDateTimeString(self): fat_date_time_object.CopyFromDateTimeString('2010-08-12') self.assertEqual(fat_date_time_object._number_of_seconds, 966038400) - self.assertEqual(fat_date_time_object._time_zone_offset, 0) + self.assertEqual(fat_date_time_object._time_zone_offset, None) fat_date_time_object.CopyFromDateTimeString('2010-08-12 21:06:31') self.assertEqual(fat_date_time_object._number_of_seconds, 966114391) - self.assertEqual(fat_date_time_object._time_zone_offset, 0) + self.assertEqual(fat_date_time_object._time_zone_offset, None) fat_date_time_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875') self.assertEqual(fat_date_time_object._number_of_seconds, 966114391) - self.assertEqual(fat_date_time_object._time_zone_offset, 0) + self.assertEqual(fat_date_time_object._time_zone_offset, None) fat_date_time_object.CopyFromDateTimeString( '2010-08-12 21:06:31.546875-01:00') @@ -74,7 +74,7 @@ def testCopyFromDateTimeString(self): fat_date_time_object.CopyFromDateTimeString('1980-01-02 00:00:00') self.assertEqual(fat_date_time_object._number_of_seconds, 86400) - self.assertEqual(fat_date_time_object._time_zone_offset, 0) + self.assertEqual(fat_date_time_object._time_zone_offset, None) with self.assertRaises(ValueError): fat_date_time_object.CopyFromDateTimeString('2200-01-02 00:00:00') @@ -204,15 +204,15 @@ def testCopyFromDateTimeString(self): fat_timestamp_object.CopyFromDateTimeString('2021-07-09') self.assertEqual(fat_timestamp_object._timestamp, 131025600000) - self.assertEqual(fat_timestamp_object._time_zone_offset, 0) + self.assertEqual(fat_timestamp_object._time_zone_offset, None) fat_timestamp_object.CopyFromDateTimeString('2021-07-09 22:11:30') self.assertEqual(fat_timestamp_object._timestamp, 131033589000) - self.assertEqual(fat_timestamp_object._time_zone_offset, 0) + self.assertEqual(fat_timestamp_object._time_zone_offset, None) fat_timestamp_object.CopyFromDateTimeString('2021-07-09 22:11:30.246875') self.assertEqual(fat_timestamp_object._timestamp, 131033589024) - self.assertEqual(fat_timestamp_object._time_zone_offset, 0) + self.assertEqual(fat_timestamp_object._time_zone_offset, None) fat_timestamp_object.CopyFromDateTimeString( '2021-07-09 22:11:30.246875-01:00') @@ -226,7 +226,7 @@ def testCopyFromDateTimeString(self): fat_timestamp_object.CopyFromDateTimeString('1980-01-02 00:00:00') self.assertEqual(fat_timestamp_object._timestamp, 8640000) - self.assertEqual(fat_timestamp_object._time_zone_offset, 0) + self.assertEqual(fat_timestamp_object._time_zone_offset, None) with self.assertRaises(ValueError): fat_timestamp_object.CopyFromDateTimeString('2200-01-02 00:00:00') diff --git a/tests/filetime.py b/tests/filetime.py index dbf8981..664b802 100644 --- a/tests/filetime.py +++ b/tests/filetime.py @@ -65,15 +65,15 @@ def testCopyFromDateTimeString(self): filetime_object.CopyFromDateTimeString('2010-08-12') self.assertEqual(filetime_object._timestamp, 0x1cb39b14e8c4000) - self.assertEqual(filetime_object._time_zone_offset, 0) + self.assertEqual(filetime_object._time_zone_offset, None) filetime_object.CopyFromDateTimeString('2010-08-12 21:06:31') self.assertEqual(filetime_object._timestamp, 0x1cb3a623cb6a580) - self.assertEqual(filetime_object._time_zone_offset, 0) + self.assertEqual(filetime_object._time_zone_offset, None) filetime_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875') self.assertEqual(filetime_object._timestamp, 0x01cb3a623d0a17ce) - self.assertEqual(filetime_object._time_zone_offset, 0) + self.assertEqual(filetime_object._time_zone_offset, None) filetime_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875-01:00') self.assertEqual(filetime_object._timestamp, 0x01cb3a623d0a17ce) @@ -85,7 +85,7 @@ def testCopyFromDateTimeString(self): filetime_object.CopyFromDateTimeString('1601-01-02 00:00:00') self.assertEqual(filetime_object._timestamp, 86400 * 10000000) - self.assertEqual(filetime_object._time_zone_offset, 0) + self.assertEqual(filetime_object._time_zone_offset, None) with self.assertRaises(ValueError): filetime_object.CopyFromDateTimeString('1500-01-02 00:00:00') diff --git a/tests/golang_time.py b/tests/golang_time.py index 1096e9d..bd8de30 100644 --- a/tests/golang_time.py +++ b/tests/golang_time.py @@ -143,27 +143,27 @@ def testCopyFromDateTimeString(self): golang_time_object.CopyFromDateTimeString('0001-01-01') self.assertEqual(golang_time_object._number_of_seconds, 0) self.assertEqual(golang_time_object._nanoseconds, 0) - self.assertEqual(golang_time_object._time_zone_offset, 0) + self.assertEqual(golang_time_object._time_zone_offset, None) golang_time_object.CopyFromDateTimeString('0001-01-01 00:01:00') self.assertEqual(golang_time_object._number_of_seconds, 60) self.assertEqual(golang_time_object._nanoseconds, 0) - self.assertEqual(golang_time_object._time_zone_offset, 0) + self.assertEqual(golang_time_object._time_zone_offset, None) golang_time_object.CopyFromDateTimeString('0001-01-01 00:00:00.000001') self.assertEqual(golang_time_object._number_of_seconds, 0) self.assertEqual(golang_time_object._nanoseconds, 1000) - self.assertEqual(golang_time_object._time_zone_offset, 0) + self.assertEqual(golang_time_object._time_zone_offset, None) golang_time_object.CopyFromDateTimeString('2000-01-01') self.assertEqual(golang_time_object._number_of_seconds, 63082281600) self.assertEqual(golang_time_object._nanoseconds, 0) - self.assertEqual(golang_time_object._time_zone_offset, 0) + self.assertEqual(golang_time_object._time_zone_offset, None) golang_time_object.CopyFromDateTimeString('2000-01-01 12:23:45.567890') self.assertEqual(golang_time_object._number_of_seconds, 63082326225) self.assertEqual(golang_time_object._nanoseconds, 567890000) - self.assertEqual(golang_time_object._time_zone_offset, 0) + self.assertEqual(golang_time_object._time_zone_offset, None) golang_time_object.CopyFromDateTimeString( '2000-01-01 12:23:45.567890+01:00') diff --git a/tests/hfs_time.py b/tests/hfs_time.py index 6642d35..4728487 100644 --- a/tests/hfs_time.py +++ b/tests/hfs_time.py @@ -70,15 +70,15 @@ def testCopyFromDateTimeString(self): hfs_time_object.CopyFromDateTimeString('2013-08-01') self.assertEqual(hfs_time_object._timestamp, 3458160000) - self.assertEqual(hfs_time_object._time_zone_offset, 0) + self.assertEqual(hfs_time_object._time_zone_offset, None) hfs_time_object.CopyFromDateTimeString('2013-08-01 15:25:28') self.assertEqual(hfs_time_object._timestamp, 3458215528) - self.assertEqual(hfs_time_object._time_zone_offset, 0) + self.assertEqual(hfs_time_object._time_zone_offset, None) hfs_time_object.CopyFromDateTimeString('2013-08-01 15:25:28.546875') self.assertEqual(hfs_time_object._timestamp, 3458215528) - self.assertEqual(hfs_time_object._time_zone_offset, 0) + self.assertEqual(hfs_time_object._time_zone_offset, None) hfs_time_object.CopyFromDateTimeString('2013-08-01 15:25:28.546875-01:00') self.assertEqual(hfs_time_object._timestamp, 3458215528) @@ -90,7 +90,7 @@ def testCopyFromDateTimeString(self): hfs_time_object.CopyFromDateTimeString('1904-01-02 00:00:00') self.assertEqual(hfs_time_object._timestamp, 86400) - self.assertEqual(hfs_time_object._time_zone_offset, 0) + self.assertEqual(hfs_time_object._time_zone_offset, None) with self.assertRaises(ValueError): hfs_time_object.CopyFromDateTimeString('1600-01-02 00:00:00') diff --git a/tests/java_time.py b/tests/java_time.py index 75cf2ac..df651e5 100644 --- a/tests/java_time.py +++ b/tests/java_time.py @@ -51,15 +51,15 @@ def testCopyFromDateTimeString(self): java_time_object.CopyFromDateTimeString('2010-08-12') self.assertEqual(java_time_object._timestamp, 1281571200000) - self.assertEqual(java_time_object._time_zone_offset, 0) + self.assertEqual(java_time_object._time_zone_offset, None) java_time_object.CopyFromDateTimeString('2010-08-12 21:06:31') self.assertEqual(java_time_object._timestamp, 1281647191000) - self.assertEqual(java_time_object._time_zone_offset, 0) + self.assertEqual(java_time_object._time_zone_offset, None) java_time_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875') self.assertEqual(java_time_object._timestamp, 1281647191546) - self.assertEqual(java_time_object._time_zone_offset, 0) + self.assertEqual(java_time_object._time_zone_offset, None) java_time_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875-01:00') self.assertEqual(java_time_object._timestamp, 1281647191546) @@ -71,7 +71,7 @@ def testCopyFromDateTimeString(self): java_time_object.CopyFromDateTimeString('1601-01-02 00:00:00') self.assertEqual(java_time_object._timestamp, -11644387200000) - self.assertEqual(java_time_object._time_zone_offset, 0) + self.assertEqual(java_time_object._time_zone_offset, None) def testCopyToDateTimeString(self): """Tests the CopyToDateTimeString function.""" diff --git a/tests/ole_automation_date.py b/tests/ole_automation_date.py index e6a6ce1..27ac689 100644 --- a/tests/ole_automation_date.py +++ b/tests/ole_automation_date.py @@ -69,16 +69,16 @@ def testCopyFromDateTimeString(self): ole_automation_date_object.CopyFromDateTimeString('2017-11-05') self.assertEqual(ole_automation_date_object._timestamp, 43044.0) - self.assertEqual(ole_automation_date_object._time_zone_offset, 0) + self.assertEqual(ole_automation_date_object._time_zone_offset, None) ole_automation_date_object.CopyFromDateTimeString('2017-11-05 11:32:00') self.assertEqual(ole_automation_date_object._timestamp, 43044.48055555555) - self.assertEqual(ole_automation_date_object._time_zone_offset, 0) + self.assertEqual(ole_automation_date_object._time_zone_offset, None) ole_automation_date_object.CopyFromDateTimeString( '2017-11-05 11:32:00.546875') self.assertEqual(ole_automation_date_object._timestamp, 43044.480561885124) - self.assertEqual(ole_automation_date_object._time_zone_offset, 0) + self.assertEqual(ole_automation_date_object._time_zone_offset, None) ole_automation_date_object.CopyFromDateTimeString( '2017-11-05 11:32:00.546875-01:00') @@ -92,7 +92,7 @@ def testCopyFromDateTimeString(self): ole_automation_date_object.CopyFromDateTimeString('1900-01-01 00:00:00') self.assertEqual(ole_automation_date_object._timestamp, 2.0) - self.assertEqual(ole_automation_date_object._time_zone_offset, 0) + self.assertEqual(ole_automation_date_object._time_zone_offset, None) def testCopyToDateTimeString(self): """Tests the CopyToDateTimeString function.""" diff --git a/tests/posix_time.py b/tests/posix_time.py index ed7664e..cf878bc 100644 --- a/tests/posix_time.py +++ b/tests/posix_time.py @@ -60,15 +60,15 @@ def testCopyFromDateTimeString(self): posix_time_object.CopyFromDateTimeString('2010-08-12') self.assertEqual(posix_time_object._timestamp, 1281571200) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) posix_time_object.CopyFromDateTimeString('2010-08-12 21:06:31') self.assertEqual(posix_time_object._timestamp, 1281647191) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) posix_time_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875') self.assertEqual(posix_time_object._timestamp, 1281647191) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) posix_time_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875-01:00') self.assertEqual(posix_time_object._timestamp, 1281647191) @@ -80,7 +80,7 @@ def testCopyFromDateTimeString(self): posix_time_object.CopyFromDateTimeString('1601-01-02 00:00:00') self.assertEqual(posix_time_object._timestamp, -11644387200) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) def testCopyToDateTimeString(self): """Tests the CopyToDateTimeString function.""" @@ -215,15 +215,15 @@ def testCopyFromDateTimeString(self): posix_time_object.CopyFromDateTimeString('2010-08-12') self.assertEqual(posix_time_object._timestamp, 1281571200000) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) posix_time_object.CopyFromDateTimeString('2010-08-12 21:06:31') self.assertEqual(posix_time_object._timestamp, 1281647191000) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) posix_time_object.CopyFromDateTimeString('2010-08-12 21:06:31.546') self.assertEqual(posix_time_object._timestamp, 1281647191546) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) posix_time_object.CopyFromDateTimeString('2010-08-12 21:06:31.546-01:00') self.assertEqual(posix_time_object._timestamp, 1281647191546) @@ -235,7 +235,7 @@ def testCopyFromDateTimeString(self): posix_time_object.CopyFromDateTimeString('1601-01-02 00:00:00') self.assertEqual(posix_time_object._timestamp, -11644387200000) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) def testCopyToDateTimeString(self): """Tests the CopyToDateTimeString function.""" @@ -378,15 +378,15 @@ def testCopyFromDateTimeString(self): posix_time_object.CopyFromDateTimeString('2010-08-12') self.assertEqual(posix_time_object._timestamp, 1281571200000000) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) posix_time_object.CopyFromDateTimeString('2010-08-12 21:06:31') self.assertEqual(posix_time_object._timestamp, 1281647191000000) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) posix_time_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875') self.assertEqual(posix_time_object._timestamp, 1281647191546875) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) posix_time_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875-01:00') self.assertEqual(posix_time_object._timestamp, 1281647191546875) @@ -398,7 +398,7 @@ def testCopyFromDateTimeString(self): posix_time_object.CopyFromDateTimeString('1601-01-02 00:00:00') self.assertEqual(posix_time_object._timestamp, -11644387200000000) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) def testCopyToDateTimeString(self): """Tests the CopyToDateTimeString function.""" @@ -542,15 +542,15 @@ def testCopyFromDateTimeString(self): posix_time_object.CopyFromDateTimeString('2010-08-12') self.assertEqual(posix_time_object.timestamp, 1281571200000000000) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) posix_time_object.CopyFromDateTimeString('2010-08-12 21:06:31') self.assertEqual(posix_time_object.timestamp, 1281647191000000000) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) posix_time_object.CopyFromDateTimeString('2010-08-12 21:06:31.654321') self.assertEqual(posix_time_object.timestamp, 1281647191654321000) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) posix_time_object.CopyFromDateTimeString( '2010-08-12 21:06:31.654321-01:00') @@ -564,7 +564,7 @@ def testCopyFromDateTimeString(self): posix_time_object.CopyFromDateTimeString('1601-01-02 00:00:00') self.assertEqual(posix_time_object.timestamp, -11644387200000000000) - self.assertEqual(posix_time_object._time_zone_offset, 0) + self.assertEqual(posix_time_object._time_zone_offset, None) def testCopyToDateTimeString(self): """Tests the CopyToDateTimeString function.""" diff --git a/tests/rfc2579_date_time.py b/tests/rfc2579_date_time.py index bea5eed..f7a4443 100644 --- a/tests/rfc2579_date_time.py +++ b/tests/rfc2579_date_time.py @@ -137,7 +137,7 @@ def testCopyFromDateTimeString(self): rfc2579_date_time_object.CopyFromDateTimeString('2010-08-12') self.assertEqual(rfc2579_date_time_object._number_of_seconds, 1281571200) - self.assertEqual(rfc2579_date_time_object._time_zone_offset, 0) + self.assertEqual(rfc2579_date_time_object._time_zone_offset, None) self.assertEqual(rfc2579_date_time_object.year, 2010) self.assertEqual(rfc2579_date_time_object.month, 8) self.assertEqual(rfc2579_date_time_object.day_of_month, 12) @@ -148,7 +148,7 @@ def testCopyFromDateTimeString(self): rfc2579_date_time_object.CopyFromDateTimeString('2010-08-12 21:06:31') self.assertEqual(rfc2579_date_time_object._number_of_seconds, 1281647191) - self.assertEqual(rfc2579_date_time_object._time_zone_offset, 0) + self.assertEqual(rfc2579_date_time_object._time_zone_offset, None) self.assertEqual(rfc2579_date_time_object.year, 2010) self.assertEqual(rfc2579_date_time_object.month, 8) self.assertEqual(rfc2579_date_time_object.day_of_month, 12) @@ -160,7 +160,7 @@ def testCopyFromDateTimeString(self): rfc2579_date_time_object.CopyFromDateTimeString( '2010-08-12 21:06:31.546875') self.assertEqual(rfc2579_date_time_object._number_of_seconds, 1281647191) - self.assertEqual(rfc2579_date_time_object._time_zone_offset, 0) + self.assertEqual(rfc2579_date_time_object._time_zone_offset, None) self.assertEqual(rfc2579_date_time_object.year, 2010) self.assertEqual(rfc2579_date_time_object.month, 8) self.assertEqual(rfc2579_date_time_object.day_of_month, 12) @@ -197,7 +197,7 @@ def testCopyFromDateTimeString(self): rfc2579_date_time_object.CopyFromDateTimeString('1601-01-02 00:00:00') self.assertEqual(rfc2579_date_time_object._number_of_seconds, -11644387200) - self.assertEqual(rfc2579_date_time_object._time_zone_offset, 0) + self.assertEqual(rfc2579_date_time_object._time_zone_offset, None) self.assertEqual(rfc2579_date_time_object.year, 1601) self.assertEqual(rfc2579_date_time_object.month, 1) self.assertEqual(rfc2579_date_time_object.day_of_month, 2) diff --git a/tests/systemtime.py b/tests/systemtime.py index 2814ce3..34a8a4c 100644 --- a/tests/systemtime.py +++ b/tests/systemtime.py @@ -98,7 +98,7 @@ def testCopyFromDateTimeString(self): systemtime_object.CopyFromDateTimeString('2010-08-12') self.assertEqual(systemtime_object._number_of_seconds, 1281571200) - self.assertEqual(systemtime_object._time_zone_offset, 0) + self.assertEqual(systemtime_object._time_zone_offset, None) self.assertEqual(systemtime_object.year, 2010) self.assertEqual(systemtime_object.month, 8) self.assertEqual(systemtime_object.day_of_month, 12) @@ -109,7 +109,7 @@ def testCopyFromDateTimeString(self): systemtime_object.CopyFromDateTimeString('2010-08-12 21:06:31') self.assertEqual(systemtime_object._number_of_seconds, 1281647191) - self.assertEqual(systemtime_object._time_zone_offset, 0) + self.assertEqual(systemtime_object._time_zone_offset, None) self.assertEqual(systemtime_object.year, 2010) self.assertEqual(systemtime_object.month, 8) self.assertEqual(systemtime_object.day_of_month, 12) @@ -120,7 +120,7 @@ def testCopyFromDateTimeString(self): systemtime_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875') self.assertEqual(systemtime_object._number_of_seconds, 1281647191) - self.assertEqual(systemtime_object._time_zone_offset, 0) + self.assertEqual(systemtime_object._time_zone_offset, None) self.assertEqual(systemtime_object.year, 2010) self.assertEqual(systemtime_object.month, 8) self.assertEqual(systemtime_object.day_of_month, 12) @@ -155,7 +155,7 @@ def testCopyFromDateTimeString(self): systemtime_object.CopyFromDateTimeString('1601-01-02 00:00:00') self.assertEqual(systemtime_object._number_of_seconds, -11644387200) - self.assertEqual(systemtime_object._time_zone_offset, 0) + self.assertEqual(systemtime_object._time_zone_offset, None) self.assertEqual(systemtime_object.year, 1601) self.assertEqual(systemtime_object.month, 1) self.assertEqual(systemtime_object.day_of_month, 2) diff --git a/tests/time_elements.py b/tests/time_elements.py index 092e986..2e48a02 100644 --- a/tests/time_elements.py +++ b/tests/time_elements.py @@ -486,21 +486,21 @@ def testCopyFromDateTimeString(self): self.assertEqual( time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281571200) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromDateTimeString('2010-08-12 21:06:31') self.assertEqual( time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875') self.assertEqual( time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromDateTimeString( @@ -523,7 +523,7 @@ def testCopyFromDateTimeString(self): self.assertEqual( time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, -11644387200) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) def testCopyFromStringISO8601(self): """Tests the CopyFromStringISO8601 function.""" @@ -534,14 +534,14 @@ def testCopyFromStringISO8601(self): self.assertEqual( time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281571200) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromStringISO8601('2010-08-12T21:06:31') self.assertEqual( time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromStringISO8601('2010-08-12T21:06:31+00:00') @@ -555,21 +555,21 @@ def testCopyFromStringISO8601(self): self.assertEqual( time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromStringISO8601('2010-08-12T21:06:31.546875') self.assertEqual( time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromStringISO8601('2010-08-12T21:06:31,546875') self.assertEqual( time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromStringISO8601( @@ -884,7 +884,7 @@ def testCopyFromDateTimeString(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281571200) self.assertEqual(time_elements_object.milliseconds, 0) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromDateTimeString('2010-08-12 21:06:31') @@ -892,7 +892,7 @@ def testCopyFromDateTimeString(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) self.assertEqual(time_elements_object.milliseconds, 0) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875') @@ -900,7 +900,7 @@ def testCopyFromDateTimeString(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) self.assertEqual(time_elements_object.milliseconds, 546) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromDateTimeString( @@ -926,7 +926,7 @@ def testCopyFromDateTimeString(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, -11644387200) self.assertEqual(time_elements_object.milliseconds, 0) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) def testCopyFromStringISO8601(self): """Tests the CopyFromStringISO8601 function.""" @@ -938,7 +938,7 @@ def testCopyFromStringISO8601(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281571200) self.assertEqual(time_elements_object.milliseconds, 0) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromStringISO8601('2010-08-12T21:06:31') @@ -946,7 +946,7 @@ def testCopyFromStringISO8601(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) self.assertEqual(time_elements_object.milliseconds, 0) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromStringISO8601('2010-08-12T21:06:31+00:00') @@ -962,7 +962,7 @@ def testCopyFromStringISO8601(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) self.assertEqual(time_elements_object.milliseconds, 500) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromStringISO8601('2010-08-12T21:06:31.546875') @@ -970,7 +970,7 @@ def testCopyFromStringISO8601(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) self.assertEqual(time_elements_object.milliseconds, 546) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromStringISO8601('2010-08-12T21:06:31,546875') @@ -978,7 +978,7 @@ def testCopyFromStringISO8601(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) self.assertEqual(time_elements_object.milliseconds, 546) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromStringISO8601( @@ -1254,7 +1254,7 @@ def testCopyFromDateTimeString(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281571200) self.assertEqual(time_elements_object.microseconds, 0) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromDateTimeString('2010-08-12 21:06:31') @@ -1262,7 +1262,7 @@ def testCopyFromDateTimeString(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) self.assertEqual(time_elements_object.microseconds, 0) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875') @@ -1270,7 +1270,7 @@ def testCopyFromDateTimeString(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) self.assertEqual(time_elements_object.microseconds, 546875) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromDateTimeString( @@ -1296,7 +1296,7 @@ def testCopyFromDateTimeString(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, -11644387200) self.assertEqual(time_elements_object.microseconds, 0) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) def testCopyFromStringISO8601(self): """Tests the CopyFromStringISO8601 function.""" @@ -1308,7 +1308,7 @@ def testCopyFromStringISO8601(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281571200) self.assertEqual(time_elements_object.microseconds, 0) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromStringISO8601('2010-08-12T21:06:31') @@ -1316,7 +1316,7 @@ def testCopyFromStringISO8601(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) self.assertEqual(time_elements_object.microseconds, 0) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromStringISO8601('2010-08-12T21:06:31+00:00') @@ -1332,7 +1332,7 @@ def testCopyFromStringISO8601(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) self.assertEqual(time_elements_object.microseconds, 500000) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromStringISO8601('2010-08-12T21:06:31.546875') @@ -1340,7 +1340,7 @@ def testCopyFromStringISO8601(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) self.assertEqual(time_elements_object.microseconds, 546875) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromStringISO8601('2010-08-12T21:06:31,546875') @@ -1348,7 +1348,7 @@ def testCopyFromStringISO8601(self): time_elements_object._time_elements_tuple, expected_time_elements_tuple) self.assertEqual(time_elements_object._number_of_seconds, 1281647191) self.assertEqual(time_elements_object.microseconds, 546875) - self.assertEqual(time_elements_object._time_zone_offset, 0) + self.assertEqual(time_elements_object._time_zone_offset, None) expected_time_elements_tuple = (2010, 8, 12, 21, 6, 31) time_elements_object.CopyFromStringISO8601( diff --git a/tests/uuid_time.py b/tests/uuid_time.py index 1114a96..19f8b4f 100644 --- a/tests/uuid_time.py +++ b/tests/uuid_time.py @@ -97,15 +97,15 @@ def testCopyFromDateTimeString(self): uuid_time_object.CopyFromDateTimeString('2013-08-01') self.assertEqual(uuid_time_object._timestamp, 135946080000000000) - self.assertEqual(uuid_time_object._time_zone_offset, 0) + self.assertEqual(uuid_time_object._time_zone_offset, None) uuid_time_object.CopyFromDateTimeString('2013-08-01 15:25:28') self.assertEqual(uuid_time_object._timestamp, 135946635280000000) - self.assertEqual(uuid_time_object._time_zone_offset, 0) + self.assertEqual(uuid_time_object._time_zone_offset, None) uuid_time_object.CopyFromDateTimeString('2013-08-01 15:25:28.546875') self.assertEqual(uuid_time_object._timestamp, 135946635285468750) - self.assertEqual(uuid_time_object._time_zone_offset, 0) + self.assertEqual(uuid_time_object._time_zone_offset, None) uuid_time_object.CopyFromDateTimeString('2013-08-01 15:25:28.546875-01:00') self.assertEqual(uuid_time_object._timestamp, 135946635285468750) @@ -117,7 +117,7 @@ def testCopyFromDateTimeString(self): uuid_time_object.CopyFromDateTimeString('1582-10-16 00:00:00') self.assertEqual(uuid_time_object._timestamp, 864000000000) - self.assertEqual(uuid_time_object._time_zone_offset, 0) + self.assertEqual(uuid_time_object._time_zone_offset, None) with self.assertRaises(ValueError): uuid_time_object.CopyFromDateTimeString('1570-01-02 00:00:00') diff --git a/tests/webkit_time.py b/tests/webkit_time.py index ca5abe8..9623dc8 100644 --- a/tests/webkit_time.py +++ b/tests/webkit_time.py @@ -65,15 +65,15 @@ def testCopyFromDateTimeString(self): webkit_time_object.CopyFromDateTimeString('2010-08-12') self.assertEqual(webkit_time_object._timestamp, 12926044800000000) - self.assertEqual(webkit_time_object._time_zone_offset, 0) + self.assertEqual(webkit_time_object._time_zone_offset, None) webkit_time_object.CopyFromDateTimeString('2010-08-12 21:06:31') self.assertEqual(webkit_time_object._timestamp, 12926120791000000) - self.assertEqual(webkit_time_object._time_zone_offset, 0) + self.assertEqual(webkit_time_object._time_zone_offset, None) webkit_time_object.CopyFromDateTimeString('2010-08-12 21:06:31.546875') self.assertEqual(webkit_time_object._timestamp, 12926120791546875) - self.assertEqual(webkit_time_object._time_zone_offset, 0) + self.assertEqual(webkit_time_object._time_zone_offset, None) webkit_time_object.CopyFromDateTimeString( '2010-08-12 21:06:31.546875-01:00') @@ -87,7 +87,7 @@ def testCopyFromDateTimeString(self): webkit_time_object.CopyFromDateTimeString('1601-01-02 00:00:00') self.assertEqual(webkit_time_object._timestamp, 86400 * 1000000) - self.assertEqual(webkit_time_object._time_zone_offset, 0) + self.assertEqual(webkit_time_object._time_zone_offset, None) def testCopyToDateTimeString(self): """Tests the CopyToDateTimeString function."""