-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify timestamp format used by adapter (#12)
* Unify timestamp format used by adapter * Refactor and move time formating to reusable function
- Loading branch information
Showing
4 changed files
with
16 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package postgres | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
// TimeLayout used by PostgreSQL adapter. | ||
const TimeLayout = "2006-01-02 15:04:05.999999999Z07:00:00" | ||
|
||
// FormatTime formats time to PostgreSQL format. | ||
func FormatTime(t time.Time) string { | ||
return t.Truncate(time.Microsecond).Format(TimeLayout) | ||
} |