1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-09 09:35:00 +09:00
anytype-heart/util/time/time.go
2023-05-24 17:10:52 +02:00

15 lines
342 B
Go

package time
import (
"time"
"github.com/gogo/protobuf/types"
"github.com/anyproto/anytype-heart/util/pbtypes"
)
func CutValueToDay(val *types.Value) *types.Value {
t := time.Unix(int64(val.GetNumberValue()), 0)
roundTime := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, t.Location())
return pbtypes.Int64(roundTime.Unix())
}