func Timestamp(ts *timestamppb.Timestamp) (time.Time, error) {
	// Don't return the zero value on error, because corresponds to a valid
	// timestamp. Instead return whatever time.Unix gives us.
	var t time.Time
	if ts == nil {
		t = time.Unix(0, 0).UTC() // treat nil like the empty Timestamp
	} else {
		t = time.Unix(ts.Seconds, int64(ts.Nanos)).UTC()
	}
	return t, validateTimestamp(ts)
}
// Timestamp converts a timestamppb.Timestamp to a time.Time.
// It returns an error if the argument is invalid.
//
// Unlike most Go functions, if Timestamp returns an error, the first return
// value is not the zero time.Time. Instead, it is the value obtained from the
// time.Unix function when passed the contents of the Timestamp, in the UTC
// locale. This may or may not be a meaningful time; many invalid Timestamps
// do map to valid time.Times.
//
// A nil Timestamp returns an error. The first return value in that case is
// undefined.
Timestamp converts a timestamppb.Timestamp to a time.Time.
It returns an error if the argument is invalid.

Unlike most Go functions, if Timestamp returns an error, the first return
value is not the zero time.Time. Instead, it is the value obtained from the
time.Unix function when passed the contents of the Timestamp, in the UTC
locale. This may or may not be a meaningful time; many invalid Timestamps
do map to valid time.Times.

A nil Timestamp returns an error. The first return value in that case is
undefined.
// Timestamp converts a timestamppb . Timestamp to a time . Time . // It returns an error if the argument is invalid . // // Unlike most Go functions if Timestamp returns an error the first return // value is not the zero time . Time . Instead it is the value obtained from the // time . Unix function when passed the contents of the Timestamp in the UTC // locale . This may or may not be a meaningful time ; many invalid Timestamps // do map to valid time . Times . // // A nil Timestamp returns an error . The first return value in that case is // undefined .
func Timestamp(ts *timestamppb.Timestamp) (time.Time, error) {
	var t time.Time
	if ts == nil {
		t = time.Unix(0, 0).UTC() 
	} else {
		t = time.Unix(ts.Seconds, int64(ts.Nanos)).UTC()
	}
	return t, validateTimestamp(ts)
}
func Timestamp ( ts * timestamppb . Timestamp ) ( time . Time , error ) { var t time . Time if ts == nil { t = time . Unix ( 0 , 0 ) . UTC ( ) } else { t = time . Unix ( ts . Seconds , int64 ( ts . Nanos ) ) . UTC ( ) } return t , validateTimestamp ( ts ) }
Timestamp converts a timestamppb.Timestamp to a time.Time.
Timestamp converts a timestamppb . Timestamp to a time . Time .
// Don't return the zero value on error, because corresponds to a valid // timestamp. Instead return whatever time.Unix gives us. // treat nil like the empty Timestamp