New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for persisting dates with microsecond precision #29

Merged
merged 1 commit into from Mar 13, 2018

Conversation

2 participants
@MrMage
Copy link
Contributor

MrMage commented Mar 13, 2018

Note that I have not made parsing the textual format of the timestamp type more accurate - do we need that? If so, where is that format documented?

MrMage added a commit to MrMage/fluent-postgresql that referenced this pull request Mar 13, 2018

MrMage added a commit to MrMage/fluent that referenced this pull request Mar 13, 2018

@MrMage MrMage force-pushed the MrMage:fix-date-format branch from c1b35e8 to 2c5b88a Mar 13, 2018

MrMage added a commit to MrMage/fluent that referenced this pull request Mar 13, 2018

@tanner0101 tanner0101 changed the base branch from master to nio Mar 13, 2018

@tanner0101
Copy link
Member

tanner0101 left a comment

nice, that was easy :)

@@ -37,7 +37,8 @@ extension Date: PostgreSQLDataCustomConvertible {

/// See `PostgreSQLDataCustomConvertible.convertToPostgreSQLData()`
public func convertToPostgreSQLData() throws -> PostgreSQLData {
return PostgreSQLData(type: .timestamp, format: .text, data: Data(description.utf8))
return PostgreSQLData(type: .timestamp, format: .binary,
data: Int64(self.timeIntervalSince(_psqlDateStart) * Double(_microsecondsPerSecond)).data)

This comment has been minimized.

@tanner0101

tanner0101 Mar 13, 2018

Member

please format with only 1 tab indentation, or all on one line (no "xcode formatting")

This comment has been minimized.

@MrMage

MrMage Mar 13, 2018

Author Contributor

Done.

@tanner0101 tanner0101 added this to the 1.0.0-rc.2 milestone Mar 13, 2018

@tanner0101 tanner0101 self-assigned this Mar 13, 2018

MrMage added a commit to MrMage/fluent that referenced this pull request Mar 13, 2018

Add support for persisting dates with microsecond precision.
Note that I have not made parsing the textual format of the timestamp type more accurate - do we need that? If so, where is that format documented?

@MrMage MrMage force-pushed the MrMage:fix-date-format branch from 2c5b88a to c36db27 Mar 13, 2018

@tanner0101 tanner0101 merged commit 42fbe05 into vapor:nio Mar 13, 2018

1 check passed

ci/circleci: linux Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment