Skip to content

Commit

Permalink
Use 24-hour format for timestamp (segmentio#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
bouk authored and tejasmanohar committed Feb 2, 2018
1 parent 18d51f3 commit 2066e3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ func TestQuery(t *testing.T) {
StringType: "another string",
TimestampType: athenaTimestamp(time.Date(2017, 12, 3, 1, 11, 12, 0, time.UTC)),
},
{
SmallintType: 9,
IntType: 8,
BigintType: 0,
BooleanType: false,
DoubleType: 1.235,
StringType: "another string",
TimestampType: athenaTimestamp(time.Date(2017, 12, 3, 20, 11, 12, 0, time.UTC)),
},
}
expectedTypeNames := []string{"varchar", "smallint", "integer", "bigint", "boolean", "double", "varchar", "timestamp"}
harness.uploadData(expected)
Expand Down
2 changes: 1 addition & 1 deletion value.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const (
// TimestampLayout is the Go time layout string for an Athena `timestamp`.
TimestampLayout = "2006-01-02 03:04:05.999"
TimestampLayout = "2006-01-02 15:04:05.999"
)

func convertRow(columns []*athena.ColumnInfo, in []*athena.Datum, ret []driver.Value) error {
Expand Down

0 comments on commit 2066e3f

Please sign in to comment.