Skip to content

Commit 06745d8

Browse files
committed
Use more pythonic approach
Change-Id: I6a08764d47047a349cc09df3ba6907a9c840a8f5
1 parent a55be24 commit 06745d8

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

python/pyarrow/scalar.pyx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,10 @@ cdef class UInt64Value(ArrayValue):
124124

125125

126126
cdef class DateValue(ArrayValue):
127-
# fromtimestamp will convert to local time.
128-
# This is the offset we need to add to ensure to have the correct date.
129-
_timezone_offset = (datetime.datetime(1970, 1, 1) - datetime.datetime.fromtimestamp(0)).total_seconds()
130127

131128
def as_py(self):
132129
cdef CDateArray* ap = <CDateArray*> self.sp_array.get()
133-
return datetime.date.fromtimestamp(ap.Value(self.index) / 1000 + DateValue._timezone_offset)
130+
return datetime.datetime.utcfromtimestamp(ap.Value(self.index) / 1000).date()
134131

135132

136133
cdef class TimestampValue(ArrayValue):

0 commit comments

Comments
 (0)