Repository navigation
Conversation
Integer inputs already become time.Unix values, but the same digits as a string failed date parsing. Accept 10+ digit numeric strings (and signed equivalents) as Unix seconds after named formats miss, fixing #102.
|
|
Author
|
Closing this PR as I will not be signing the CLA. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #102.
ToTimeE(1600285405)already succeeds because integer inputs are treated as Unix seconds, butToTimeE("1600285405")failed withunable to parse date. After named/date formats miss, accept pure numeric strings with 10+ digits (including a leading+/-) as Unix seconds so the string path matches the integer path. Short values like"2006"still fail date parsing and are not treated as timestamps.Test plan
go test ./...TestTimewith string Unix cases from [BUG] Unixtimestemp in string #102 ("1600285405","1234567890") plus a pre-epoch signed string"2006"and other short numeric strings still error