Skip to content

Commit

Permalink
Use dates library instead of datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
RK206 committed Aug 29, 2023
1 parent 77aea0a commit 03778c3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions portality/tasks/preservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import shutil
import tarfile
from copy import deepcopy
from datetime import datetime
from zipfile import ZipFile

import requests
Expand Down Expand Up @@ -209,7 +208,7 @@ def prepare(cls, username, **kwargs):
:return: background job
"""

created_time = dates.format(datetime.utcnow(), "%Y-%m-%d-%H-%M-%S")
created_time = dates.now()
dir_name = username + "-" + created_time
local_dir = os.path.join(Preservation.UPLOAD_DIR, dir_name)
file = kwargs.get("upload_file")
Expand Down Expand Up @@ -727,7 +726,7 @@ def __init__(self, preservation_dir, journal_dir, owner):
self.preservation_dir = preservation_dir
self.journal_dir = journal_dir
self.package_dir = os.path.join(self.preservation_dir, journal_dir)
self.created_time = dates.format(datetime.utcnow(), "%Y-%m-%d-%H-%M-%S")
self.created_time = dates.now()
self.tar_file = self.package_dir + "_" + self.created_time + ".tar.gz"
self.tar_file_name = os.path.basename(self.tar_file)
self.__owner = owner
Expand Down

0 comments on commit 03778c3

Please sign in to comment.