Skip to content

Commit

Permalink
fix timestamp string representation on different platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
nicola-cab committed Jul 11, 2023
1 parent 9e7503b commit 7ff238f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

### Fixed
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?)
* None.
* Fix timestamp rapresentation when converting to json on different platforms. ([#5451](https://github.com/realm/realm-core/issues/5451)).

### Breaking changes
* None.
Expand Down
4 changes: 1 addition & 3 deletions src/realm/obj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -991,9 +991,7 @@ void out_mixed_xjson(std::ostream& out, const Mixed& val)
}
case type_Timestamp: {
out << "{\"$date\": {\"$numberLong\": \"";
auto ts = val.get<Timestamp>();
int64_t timeMillis = ts.get_seconds() * 1000 + ts.get_nanoseconds() / 1000000;
out << timeMillis;
out << util::serializer::print_value(val.get<Timestamp>());
out << "\"}}";
break;
}
Expand Down
Loading

0 comments on commit 7ff238f

Please sign in to comment.