|
1 | 1 | from abc import ABC, abstractmethod |
2 | | -from datetime import datetime, timezone |
| 2 | +from datetime import datetime |
3 | 3 | import re |
4 | 4 | from typing import Tuple, Dict, List |
5 | 5 | import textwrap |
@@ -585,9 +585,10 @@ def get_report_name(prefix: str = "") -> str: |
585 | 585 | """ |
586 | 586 | Returns the name of the .csv report |
587 | 587 | """ |
588 | | - day = datetime.now().day |
589 | | - month = datetime.now().month |
590 | | - year = datetime.now().year |
| 588 | + currentTime = datetime.now() |
| 589 | + day = currentTime.day |
| 590 | + month = currentTime.month |
| 591 | + year = currentTime.year |
591 | 592 | date_key = f"{year}-{str(month).zfill(2)}-{str(day).zfill(2)}" |
592 | 593 | return f"{prefix}{date_key}.csv" |
593 | 594 |
|
@@ -774,7 +775,7 @@ def include_stats(self, model_stats) -> bool: |
774 | 775 | # Filter out build if it is too old |
775 | 776 | if not self.days is None: |
776 | 777 | build_day = model_stats[fs.Keys.TIMESTAMP] |
777 | | - today = datetime.now(timezone.utc) |
| 778 | + today = datetime.now() |
778 | 779 | delta = today - build_day |
779 | 780 | if delta.days > self.days: |
780 | 781 | return False |
@@ -891,7 +892,7 @@ def matching_builds(build_stats_1: Dict, build_stats_2: Dict) -> bool: |
891 | 892 |
|
892 | 893 | @staticmethod |
893 | 894 | def get_report_name() -> str: |
894 | | - current_time = datetime.now(timezone.utc) |
| 895 | + current_time = datetime.now() |
895 | 896 | timestamp = current_time.strftime("%Y-%m-%d-%H%M%S") |
896 | 897 | return f"{timestamp}_perf.csv" |
897 | 898 |
|
|
0 commit comments