opendate 0.1.7__tar.gz → 0.1.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of opendate might be problematic. Click here for more details.
- {opendate-0.1.7 → opendate-0.1.8}/PKG-INFO +1 -1
- {opendate-0.1.7 → opendate-0.1.8}/pyproject.toml +1 -1
- {opendate-0.1.7 → opendate-0.1.8}/src/date/__init__.py +1 -1
- {opendate-0.1.7 → opendate-0.1.8}/src/date/date.py +6 -5
- {opendate-0.1.7 → opendate-0.1.8}/LICENSE +0 -0
- {opendate-0.1.7 → opendate-0.1.8}/README.md +0 -0
- {opendate-0.1.7 → opendate-0.1.8}/src/date/extras.py +0 -0
|
@@ -1068,19 +1068,20 @@ class Time(_pendulum.Time):
|
|
|
1068
1068
|
|
|
1069
1069
|
return cls(obj.hour, obj.minute, obj.second, obj.microsecond, tzinfo=tz)
|
|
1070
1070
|
|
|
1071
|
-
|
|
1072
|
-
def astimezone(self, tz: str | _zoneinfo.ZoneInfo | _datetime.tzinfo):
|
|
1071
|
+
def in_timezone(self, tz: str | _zoneinfo.ZoneInfo | _datetime.tzinfo):
|
|
1073
1072
|
"""Convert timezone
|
|
1074
1073
|
|
|
1075
|
-
>>> Time(12, 0).
|
|
1074
|
+
>>> Time(12, 0).in_timezone(Timezone('America/Sao_Paulo'))
|
|
1076
1075
|
Time(9, 0, 0, tzinfo=Timezone('America/Sao_Paulo'))
|
|
1077
1076
|
|
|
1078
|
-
>>> Time(12, 0, tzinfo=Timezone('Europe/Moscow')).
|
|
1077
|
+
>>> Time(12, 0, tzinfo=Timezone('Europe/Moscow')).in_timezone(Timezone('America/Sao_Paulo'))
|
|
1079
1078
|
Time(6, 0, 0, tzinfo=Timezone('America/Sao_Paulo'))
|
|
1080
1079
|
|
|
1081
1080
|
"""
|
|
1082
1081
|
_dt = DateTime.combine(Date.today(), self, tzinfo=self.tzinfo or UTC)
|
|
1083
|
-
return _dt.
|
|
1082
|
+
return _dt.in_timezone(tz).time()
|
|
1083
|
+
|
|
1084
|
+
in_tz = in_timezone
|
|
1084
1085
|
|
|
1085
1086
|
|
|
1086
1087
|
class DateTime(DateBusinessMixin, _pendulum.DateTime):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|