Skip to content

[EventHub] decode ms datetime-offset #40847

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

swathipil
Copy link
Member

Service may send back either a DateTime or DateTimeOffset. Currently, Python does not account for this.

To do so, client needs to check for the symbol b"com.microsoft:datetime-offset" and decode the value.

ticks = raw_value & TICKS_MASK # Clear the top 2 bits (kind)
kind = (raw_value >> KIND_SHIFT) & 0x3 # Extract the kind value (bits 63-64)

# If we have additional bytes for timezone offset (in older format)
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: see if we should replace this with check for each kind separately: https://source.dot.net/System.Private.CoreLib/R/cfa80ba62f6f6a35.html

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants