func validateTimestamp(ts *tspb.Timestamp) error {
	if ts == nil {
		return errors.New("timestamp: nil Timestamp")
	}
	if ts.Seconds < minValidSeconds {
		return fmt.Errorf("timestamp: %v before 0001-01-01", ts)
	}
	if ts.Seconds >= maxValidSeconds {
		return fmt.Errorf("timestamp: %v after 10000-01-01", ts)
	}
	if ts.Nanos < 0 || ts.Nanos >= 1e9 {
		return fmt.Errorf("timestamp: %v: nanos not in range [0, 1e9)", ts)
	}
	return nil
}
validateTimestamp determines whether a Timestamp is valid.
A valid timestamp represents a time in the range
[0001-01-01, 10000-01-01) and has a Nanos field
in the range [0, 1e9).

If the Timestamp is valid, validateTimestamp returns nil.
Otherwise, it returns an error that describes
the problem.

Every valid Timestamp can be represented by a time.Time, but the converse is not true.
package ptypes
import (
	"errors"
	"fmt"
	"time"
	tspb "github.com/golang/protobuf/ptypes/timestamp"
)
const (
	minValidSeconds = -62135596800
	maxValidSeconds = 253402300800
)