Skip to content

fix: Parsing timestamptz default string#336

Merged
kodiakhq[bot] merged 4 commits intomainfrom
fix/timestamp_tz_parsing
Nov 1, 2022
Merged

fix: Parsing timestamptz default string#336
kodiakhq[bot] merged 4 commits intomainfrom
fix/timestamp_tz_parsing

Conversation

@yevgenypats
Copy link
Copy Markdown
Contributor

Another edge-case


if len(sbuf) > len(defaultStringFormat)+1 && sbuf[len(defaultStringFormat)+1] == 'm' {
sbuf = sbuf[:len(defaultStringFormat)]
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we add a test for this case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added

@disq
Copy link
Copy Markdown
Member

disq commented Nov 1, 2022

What's the edge case, can you comment in the code? is 2006-01-02 15:04:05.999999999 -0700 MSTm* valid?

@yevgenypats
Copy link
Copy Markdown
Contributor Author

What's the edge case, can you comment in the code? is 2006-01-02 15:04:05.999999999 -0700 MSTm* valid?

It's not valid, if you look at time.String() they just added manually so when you parse back you have to cut it manually as well

@kodiakhq kodiakhq bot merged commit acdcb02 into main Nov 1, 2022
@kodiakhq kodiakhq bot deleted the fix/timestamp_tz_parsing branch November 1, 2022 08:46
kodiakhq bot pushed a commit that referenced this pull request Nov 1, 2022
🤖 I have created a release *beep* *boop*
---


## [0.13.18](v0.13.17...v0.13.18) (2022-11-01)


### Bug Fixes

* Parsing timestamptz default string ([#336](#336)) ([acdcb02](acdcb02))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.

3 participants