From c14c63d63c936f3879573b4c3a4cdf8160ee5484 Mon Sep 17 00:00:00 2001 From: Nathaniel Waisbrot Date: Mon, 3 Oct 2016 08:45:41 -0400 Subject: [PATCH] Fix test failure when DB and client are not in the same time zone Explicitly set the time zone to UTC in the database and in the test expectation. Then compare the two times in the client-local time zone. --- values_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/values_test.go b/values_test.go index 7de4e0c2..9c5dbfb2 100644 --- a/values_test.go +++ b/values_test.go @@ -1095,11 +1095,11 @@ func TestRowDecode(t *testing.T) { expected []interface{} }{ { - "select row(1, 'cat', '2015-01-01 08:12:42'::timestamptz)", + "select row(1, 'cat', '2015-01-01 08:12:42-00'::timestamptz)", []interface{}{ int32(1), "cat", - time.Date(2015, 1, 1, 8, 12, 42, 0, time.Local), + time.Date(2015, 1, 1, 8, 12, 42, 0, time.UTC).Local(), }, }, }