@@ -61,7 +61,6 @@ def get_utc_offset(tz, date: datetime.datetime = None) -> datetime.timedelta:
61
61
62
62
return date .replace (tzinfo = pytz .utc ).astimezone (tz ).utcoffset ()
63
63
64
-
65
64
def get_timezone (tz : str , date : datetime .datetime = None ) -> datetime .timedelta :
66
65
"""
67
66
Returns a localized :class:`pytz.timezone` object for the given date.
@@ -82,7 +81,6 @@ def get_timezone(tz: str, date: datetime.datetime = None) -> datetime.timedelta:
82
81
83
82
return pytz .timezone (tz ).localize (d ).tzinfo
84
83
85
-
86
84
def current_tzinfo ():
87
85
"""
88
86
Returns a tzinfo object for the current timezone
@@ -127,8 +125,9 @@ def set_timezone(obj, tzinfo):
127
125
128
126
return obj .replace (tzinfo = tzinfo )
129
127
130
-
131
- def utc_timestamp_to_datetime (utc_timestamp : Union [float , int ], output_tz : datetime .tzinfo = None ) -> datetime .datetime :
128
+ def utc_timestamp_to_datetime (
129
+ utc_timestamp : Union [float , int ], output_tz : datetime .tzinfo = None
130
+ ) -> datetime .datetime :
132
131
"""
133
132
Convert UTC timestamp (seconds from UNIX epoch) to a :class:`datetime.datetime` object
134
133
@@ -157,7 +156,6 @@ def utc_timestamp_to_datetime(utc_timestamp: Union[float, int], output_tz: datet
157
156
new_datetime = datetime .datetime .fromtimestamp (utc_timestamp , output_tz )
158
157
return new_datetime .astimezone (output_tz )
159
158
160
-
161
159
# List of months and their 3-character shortcodes.
162
160
months = OrderedDict (
163
161
Jan = "January" ,
@@ -174,7 +172,6 @@ def utc_timestamp_to_datetime(utc_timestamp: Union[float, int], output_tz: datet
174
172
Dec = "December" ,
175
173
)
176
174
177
-
178
175
def parse_month (month : Union [str , int ]) -> str :
179
176
"""
180
177
Converts an integer or shorthand month into the full month name
@@ -200,7 +197,6 @@ def parse_month(month: Union[str, int]) -> str:
200
197
else :
201
198
raise ValueError ("Unrecognised month value" )
202
199
203
-
204
200
def get_month_number (month : Union [str , int ]) -> int :
205
201
"""
206
202
Returns the number of the given month. If ``month`` is already a
0 commit comments