Skip to content

Commit

Permalink
fix: Parse milliseconds (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-garcia authored May 5, 2020
1 parent 8393a21 commit bef2e31
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ impl AppleCrashReport {
"Date/Time" => {
let timestamp = DateTime::<FixedOffset>::parse_from_str(
&caps[2],
"%Y-%m-%d %H:%M:%S %z",
"%Y-%m-%d %H:%M:%S%.3f %z",
)
.map_err(ParseError::InvalidTimestamp)?;
rv.timestamp = Some(timestamp.with_timezone(&Utc));
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/bruno.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Version: 4.21.1
Code Type: X86-64
Parent Process: launchd [1]

Date/Time: 2019-01-09 17:44:22 +0000
Date/Time: 2019-01-09 12:44:22.075 +0000
OS Version: Mac OS X 10.14.0 (18A391)
Report Version: 104

Expand Down
6 changes: 2 additions & 4 deletions tests/snapshots/test_snapshots__bruno.snap
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---
created: "2019-01-23T13:22:50.862649+00:00"
creator: insta@0.5.2
expression: "&report"
source: tests/test_snapshots.rs
expression: "&report"
---
incident_identifier: 5c32df84-31a0-43e7-87d0-239f7f594940
timestamp: "2019-01-09T17:44:22Z"
timestamp: "2019-01-09T12:44:22.075Z"
code_type: X86-64
path: /Users/bruno/Documents/Unreal Projects/YetAnotherMac/MacNoEditor/YetAnotherMac.app/Contents/MacOS/YetAnotherMac
report_version: 104
Expand Down

0 comments on commit bef2e31

Please sign in to comment.