use datetime.fold to distinguish ambiguous datetimes when converting#4791
use datetime.fold to distinguish ambiguous datetimes when converting#4791
datetime.fold to distinguish ambiguous datetimes when converting#4791Conversation
a87d9ae to
0368ef0
Compare
|
We should probably do this for the IntoPyObject case as well. Current implementation will always set fold to 0. |
0c0c588 to
36be8a8
Compare
36be8a8 to
28999ab
Compare
Icxolu
left a comment
There was a problem hiding this comment.
We should probably do this for the IntoPyObject case as well. Current implementation will always set fold to 0.
Thanks! Agreed. Implementation looks good to me. Perhaps we can add a round-trip test converting (non)ambiguous DateTime<Tz> into Python, then extracting them back and make sure they are the same? What do you think?
Current test verifies this behaviour as well |
|
Great! Thanks for looking at my changes! |
#4791) * use `datetime.fold` to distinguish ambiguous datetimes when converting * Set correct fold when converting to ambiguous `chrono::DateTime<Tz>`
#4791) * use `datetime.fold` to distinguish ambiguous datetimes when converting * Set correct fold when converting to ambiguous `chrono::DateTime<Tz>`
fixes #4722