diff --git a/model/link_metadata.go b/model/link_metadata.go index d20be2cb95..6c3e0bd8fa 100644 --- a/model/link_metadata.go +++ b/model/link_metadata.go @@ -171,9 +171,9 @@ func (o *LinkMetadata) DeserializeDataToConcreteType() error { // FloorToNearestHour takes a timestamp (in milliseconds) and returns it rounded to the previous hour in UTC. func FloorToNearestHour(ms int64) int64 { - t := time.Unix(0, ms*int64(1000*1000)) + t := time.Unix(0, ms*int64(1000*1000)).UTC() - return time.Date(t.Year(), t.Month(), t.Day(), t.Hour(), 0, 0, 0, t.Location()).UnixNano() / int64(time.Millisecond) + return time.Date(t.Year(), t.Month(), t.Day(), t.Hour(), 0, 0, 0, time.UTC).UnixNano() / int64(time.Millisecond) } // isRoundedToNearestHour returns true if the given timestamp (in milliseconds) has been rounded to the nearest hour in UTC. diff --git a/store/storetest/link_metadata_store.go b/store/storetest/link_metadata_store.go index 1a083c471a..fced33dc99 100644 --- a/store/storetest/link_metadata_store.go +++ b/store/storetest/link_metadata_store.go @@ -19,7 +19,7 @@ import ( var linkMetadataTimestamp int64 = 1546300800000 func getNextLinkMetadataTimestamp() int64 { - linkMetadataTimestamp += int64(time.Hour) / 1000 + linkMetadataTimestamp += int64(time.Hour) / (1000 * 1000) return linkMetadataTimestamp }