From 5e717fd1d77ca9926fc7dc2f70a534b7a19c39ad Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Thu, 10 Oct 2024 07:40:16 -0700 Subject: [PATCH] Fix typo in the well_known_types-internal _TIMESTAMPFOMAT constant. PiperOrigin-RevId: 684439845 --- python/google/protobuf/internal/well_known_types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/google/protobuf/internal/well_known_types.py b/python/google/protobuf/internal/well_known_types.py index bbc63f4949..4e7c79a91b 100644 --- a/python/google/protobuf/internal/well_known_types.py +++ b/python/google/protobuf/internal/well_known_types.py @@ -26,7 +26,7 @@ from typing import Union FieldMask = field_mask.FieldMask -_TIMESTAMPFOMAT = '%Y-%m-%dT%H:%M:%S' +_TIMESTAMPFORMAT = '%Y-%m-%dT%H:%M:%S' _NANOS_PER_SECOND = 1000000000 _NANOS_PER_MILLISECOND = 1000000 _NANOS_PER_MICROSECOND = 1000 @@ -142,7 +142,7 @@ class Timestamp(object): 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.datetime.strptime(second_value, _TIMESTAMPFOMAT) + date_object = datetime.datetime.strptime(second_value, _TIMESTAMPFORMAT) td = date_object - datetime.datetime(1970, 1, 1) seconds = td.seconds + td.days * _SECONDS_PER_DAY if len(nano_value) > 9: