|
1 | 1 | from datetime import datetime, timedelta |
| 2 | +import pytz |
2 | 3 |
|
3 | 4 |
|
4 | 5 | class DateTimeUtils: |
@@ -71,14 +72,26 @@ def get_a_day_of_week(date: datetime) -> str: |
71 | 72 | @staticmethod |
72 | 73 | def report_timestamp_date_format() -> str: |
73 | 74 | """Gets the current datetime in the timestamp format used on the report pages.""" |
74 | | - return DateTimeUtils.format_date(datetime.now(), "%d/%m/%Y at %H:%M:%S") |
| 75 | + # Use this option if bcss is displaying correct DST times |
| 76 | + # return DateTimeUtils.format_date(datetime.now(), "%d/%m/%Y at %H:%M:%S") |
| 77 | + |
| 78 | + # Use this option if bcss is displaying UTC times |
| 79 | + return DateTimeUtils.format_date(datetime.now(pytz.utc), "%d/%m/%Y at %H:%M:%S") |
75 | 80 |
|
76 | 81 | @staticmethod |
77 | 82 | def fobt_kits_logged_but_not_read_report_timestamp_date_format() -> str: |
78 | 83 | """Gets the current datetime in the format used for FOBT Kits Logged but Not Read report.""" |
| 84 | + # Use this option if bcss is displaying correct DST times |
79 | 85 | return DateTimeUtils.format_date(datetime.now(), "%d %b %Y %H:%M:%S") |
80 | 86 |
|
| 87 | + # Use this option if bcss is displaying UTC times |
| 88 | + # return DateTimeUtils.format_date(datetime.now(pytz.utc), "%d %b %Y %H:%M:%S") |
| 89 | + |
81 | 90 | @staticmethod |
82 | 91 | def screening_practitioner_appointments_report_timestamp_date_format() -> str: |
83 | 92 | """Gets the current datetime in the format used for Screening Practitioner Appointments report.""" |
84 | | - return DateTimeUtils.format_date(datetime.now(), "%d.%m.%Y at %H:%M:%S") |
| 93 | + # Use this option if bcss is displaying correct DST times |
| 94 | + # return DateTimeUtils.format_date(datetime.now(), "%d.%m.%Y at %H:%M:%S") |
| 95 | + |
| 96 | + # Use this option if bcss is displaying UTC times |
| 97 | + return DateTimeUtils.format_date(datetime.now(pytz.utc), "%d.%m.%Y at %H:%M:%S") |
0 commit comments