Skip to content

Commit

Permalink
fix datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
korikuzma committed Apr 1, 2024
1 parent 03a8f7e commit 969cefd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/gene/database/postgresql.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Provide PostgreSQL client."""
import atexit
import datetime
import json
import logging
import os
import tarfile
import tempfile
from datetime import datetime
from pathlib import Path
from typing import Any, ClassVar, Dict, Generator, List, Optional, Set, Tuple

Expand Down Expand Up @@ -832,7 +832,7 @@ def export_db(self, output_directory: Path) -> None:
f"Output location {output_directory} isn't a directory or doesn't exist"
)
raise ValueError(err_msg)
now = datetime.now(tz=datetime.timezone.utc).strftime("%Y%m%d%H%M%S")
now = datetime.datetime.now(tz=datetime.timezone.utc).strftime("%Y%m%d%H%M%S")
output_location = output_directory / f"gene_norm_{now}.sql"
user = self.conn.info.user
host = self.conn.info.host
Expand Down
6 changes: 3 additions & 3 deletions src/gene/query.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Provides methods for handling queries."""
import datetime
import re
from datetime import datetime
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, TypeVar

from ga4gh.core import core_models, ga4gh_identify
Expand Down Expand Up @@ -283,7 +283,7 @@ def _get_service_meta() -> ServiceMeta:
"""
return ServiceMeta(
version=__version__,
response_datetime=str(datetime.now(tz=datetime.timezone.utc)),
response_datetime=str(datetime.datetime.now(tz=datetime.timezone.utc)),
)

def search(
Expand Down Expand Up @@ -560,7 +560,7 @@ def _prepare_normalized_response(self, query: str) -> Dict[str, Any]:
"warnings": self._emit_warnings(query),
"service_meta_": ServiceMeta(
version=__version__,
response_datetime=str(datetime.now(tz=datetime.timezone.utc)),
response_datetime=str(datetime.datetime.now(tz=datetime.timezone.utc)),
),
}

Expand Down

0 comments on commit 969cefd

Please sign in to comment.