1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-03-10 06:03:38 +00:00

Merge pull request #8002 from ThomasWaldmann/remove-dateutil-1.4

get rid of dateutil
This commit is contained in:
TW 2023-12-26 20:59:02 +01:00 committed by GitHub
commit 6ce8bd6fff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 5 deletions

View file

@ -10,4 +10,3 @@ pytest-xdist==3.5.0
pytest-cov==4.1.0 pytest-cov==4.1.0
pytest-benchmark==4.0.0 pytest-benchmark==4.0.0
Cython==3.0.7 Cython==3.0.7
python-dateutil==2.8.2

View file

@ -10,5 +10,4 @@ pytest-xdist
pytest-cov pytest-cov
pytest-benchmark pytest-benchmark
Cython Cython
python-dateutil
pre-commit pre-commit

View file

@ -1,5 +1,4 @@
import argparse import argparse
import dateutil.tz
import errno import errno
import io import io
import json import json
@ -2207,8 +2206,8 @@ class ArchiverTestCase(ArchiverTestCaseBase):
# Given a date and time in local tz, create a UTC timestamp string suitable # Given a date and time in local tz, create a UTC timestamp string suitable
# for create --timestamp command line option # for create --timestamp command line option
def _to_utc_timestamp(self, year, month, day, hour, minute, second): def _to_utc_timestamp(self, year, month, day, hour, minute, second):
dtime = datetime(year, month, day, hour, minute, second, 0, dateutil.tz.gettz()) dtime = datetime(year, month, day, hour, minute, second, 0).astimezone() # local time with local timezone
return dtime.astimezone(dateutil.tz.UTC).strftime("%Y-%m-%dT%H:%M:%S") return dtime.astimezone(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S")
def _create_archive_ts(self, name, y, m, d, H=0, M=0, S=0): def _create_archive_ts(self, name, y, m, d, H=0, M=0, S=0):
loc = self.repository_location + '::' + name loc = self.repository_location + '::' + name