Skip to content

Commit

Permalink
Merge pull request #21 from quadproduction/release/4.0.14
Browse files Browse the repository at this point in the history
release/4.0.14
  • Loading branch information
BenSouchet authored Dec 13, 2024
2 parents 0d8439e + 712e992 commit 007d358
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@

import calendar
import collections.abc

from datetime import datetime, timezone, timedelta
import datetime

from google.protobuf.descriptor import FieldDescriptor

Expand Down Expand Up @@ -161,8 +160,8 @@ def FromJsonString(self, value):
raise ValueError(
'time data \'{0}\' does not match format \'%Y-%m-%dT%H:%M:%S\', '
'lowercase \'t\' is not accepted'.format(second_value))
date_object = datetime.strptime(second_value, _TIMESTAMPFOMAT)
td = date_object - datetime(1970, 1, 1)
date_object = datetime.datetime.strptime(second_value, _TIMESTAMPFOMAT)
td = date_object - datetime.datetime(1970, 1, 1)
seconds = td.seconds + td.days * _SECONDS_PER_DAY
if len(nano_value) > 9:
raise ValueError(
Expand Down Expand Up @@ -193,7 +192,7 @@ def FromJsonString(self, value):

def GetCurrentTime(self):
"""Get the current UTC into Timestamp."""
self.FromDatetime(datetime.now(timezone.utc))
self.FromDatetime(datetime.datetime.utcnow())

def ToNanoseconds(self):
"""Converts Timestamp to nanoseconds since epoch."""
Expand Down Expand Up @@ -245,7 +244,7 @@ def ToDatetime(self, tzinfo=None):
Otherwise, returns a timezone-aware datetime in the input timezone.
"""
delta = timedelta(
delta = datetime.timedelta(
seconds=self.seconds,
microseconds=_RoundTowardZero(self.nanos, _NANOS_PER_MICROSECOND))
if tzinfo is None:
Expand Down Expand Up @@ -383,7 +382,7 @@ def FromSeconds(self, seconds):

def ToTimedelta(self):
"""Converts Duration to timedelta."""
return timedelta(
return datetime.timedelta(
seconds=self.seconds, microseconds=_RoundTowardZero(
self.nanos, _NANOS_PER_MICROSECOND))

Expand Down
2 changes: 1 addition & 1 deletion src/quadpype/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""File declaring QuadPype version."""
__version__ = "4.0.13"
__version__ = "4.0.14"

0 comments on commit 007d358

Please sign in to comment.