Skip to content

Commit 556a346

Browse files
committed
Fix datetime() not setting the timezone to UTC by default.
1 parent cbc8184 commit 556a346

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Fixed
66

77
- Fixed `set()` not acception the `tz` keyword argument.
8+
- Fixed `datetime()` not setting the timezone to `UTC` by default.
89

910

1011
## [1.5.0] - 2018-04-16

pendulum/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,6 @@ def datetime(year, month, day,
9090

9191
return Pendulum(
9292
year, month, day, hour, minute, second, microsecond,
93-
tzinfo=tzinfo or tz,
93+
tzinfo=tzinfo or tz or UTC,
9494
fold=fold
9595
)

tests/test_helpers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ def test_datetime(self):
180180
dt = pendulum.datetime(2018, 4, 4, 12, 34, 56, 123456)
181181

182182
self.assertPendulum(dt, 2018, 4, 4, 12, 34, 56, 123456)
183+
assert dt.timezone_name == 'UTC'
183184

184185
dt = pendulum.datetime(
185186
2013, 3, 31, 2, 30,

0 commit comments

Comments
 (0)