-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This fixes an issue that `fields` has with dates sent in the `###.######` format. If you send a date in the format `#####.######` we'll parse the bit before the decimal place as the number of milliseconds since epoch and we'll parse the bit after the decimal as the number of nanoseconds since the start of that millisecond. This works and is convenient for some folks. Sadly, the code that back the `fields` API for dates doesn't work with the string format in this case - it works with a `double`. `double` is bad for two reasons: 1. It's default string representation is scientific notation and our parsers don't know how to deal with that. 2. It loses precision relative to the string representation. `double` only has 52 bits of mantissa which can precisely store the number of nanoseconds until about 6am on April 15th, 1970. After that it starts to lose precision. This fixed the first issue, getting us the correct string representation is a "quick and dirty" way. It just converts the `double` back to a string. But we still lose precision. Fixing that would require a larger change.....
- Loading branch information
Showing
7 changed files
with
258 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.