Skip to content

IOTSDK-24021: Fix parsing of server DateTime #1499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

diachenko-mischa
Copy link
Collaborator

std::get_time does not claim support of time zones in the string parameter, and seems to be subject of locale set on the system. An example is a following result on linux:

ParseTime(Thu, 1 Jan 1970 0:00:00 GMT)=-2209075200

::strptime is also a subject to the time zones of locale, but it also claim support for parsing a time zone from the passed string. Thus, additional logic incorporated to offset parsed DataTime to the local timezone.

@diachenko-mischa diachenko-mischa force-pushed the mdiachenko/FixParsingOfServerDateTime branch from ea7c688 to 57a10d9 Compare April 19, 2024 15:33
@diachenko-mischa diachenko-mischa force-pushed the mdiachenko/FixParsingOfServerDateTime branch from 57a10d9 to be42396 Compare April 22, 2024 10:40
Copy link
Collaborator

@mykolamalik mykolamalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the names of functions and variables in order to follow the project's code style: UpperCamelCase for function names, snake_case for variables

@diachenko-mischa diachenko-mischa force-pushed the mdiachenko/FixParsingOfServerDateTime branch from 11fbf3a to d229e49 Compare April 22, 2024 15:15
std::get_time does not claim support of time zones in the string
parameter, and seems to be subject of locale set on the system. An
example is a following result on linux:

ParseTime(Thu, 1 Jan 1970 0:00:00 GMT)=-2209075200

::strptime is also a subject to the time zones of locale, but it also
claim support for parsing a time zone from the passed string. Thus,
additional logic incorporated to offset parsed DataTime to the local
timezone.

Relates-To: IOTSDK-24021

Signed-off-by: Mykhailo Diachenko <ext-mykhailo.z.diachenko@here.com>
@diachenko-mischa diachenko-mischa force-pushed the mdiachenko/FixParsingOfServerDateTime branch from d229e49 to ab589d4 Compare April 22, 2024 15:54
@diachenko-mischa
Copy link
Collaborator Author

Please update the names of functions and variables in order to follow the project's code style: UpperCamelCase for function names, snake_case for variables

Fixed

@diachenko-mischa diachenko-mischa merged commit 21f5f8f into master Apr 23, 2024
17 checks passed
@diachenko-mischa diachenko-mischa deleted the mdiachenko/FixParsingOfServerDateTime branch April 23, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants