Преглед изворни кода

dont loose subsecond precision when dealing with timestamp or (#9851)

timestamptz
Sven Klemm пре 8 година
родитељ
комит
26ab25b7c0
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      pkg/tsdb/postgres/postgres.go

+ 1 - 1
pkg/tsdb/postgres/postgres.go

@@ -187,7 +187,7 @@ func (e PostgresQueryEndpoint) transformToTimeSeries(query *tsdb.Query, rows *co
 		case float64:
 			timestamp = columnValue * 1000
 		case time.Time:
-			timestamp = float64(columnValue.Unix() * 1000)
+			timestamp = float64(columnValue.UnixNano() / 1e6)
 		default:
 			return fmt.Errorf("Invalid type for column time, must be of type timestamp or unix timestamp")
 		}