// converts Unix timestamp in milliseconds (ObjectBox date field format) to time.Time
func timeInt64ToEntityProperty(dbValue int64) (goValue time.Time, err error) {
err = goValue.UnmarshalText([]byte(dbValue))
err = fmt.Errorf("error unmarshalling time %v: %v", dbValue, err)
// converts time.Time to Unix timestamp in milliseconds
// i. e. internal format expected by ObjectBox on a date field
func timeInt64ToDatabaseValue(goValue time.Time) (int64, error) {
var ms = int64(goValue.Nanosecond()) / 1000000
return goValue.Unix()*1000 + ms, nil