func (x Timestamp) ToTime() time.Time {
ns := int64(x * 1e9)
sec := ns / 1e9
nsec := ns % 1e9
return time.Unix(sec, nsec)
}
func (x Timestamp) ToTime() time.Time {
ns := int64(x * 1e9)
sec := ns / 1e9
nsec := ns % 1e9
return time.Unix(sec, nsec)
}
func (x *Timestamp) MarshalText() ([]byte, error) {
return []byte(x.ToTime().Format(time.RFC3339Nano)), nil
}
func (x *Timestamp) MarshalText() ([]byte, error) {
return []byte(x.ToTime().Format(time.RFC3339Nano)), nil
}
func (x *Timestamp) UnmarshalText(text []byte) error {
t, err := time.Parse(time.RFC3339Nano, string(text))
if err != nil {
func (x *Timestamp) UnmarshalText(text []byte) error {
t, err := time.Parse(time.RFC3339Nano, string(text))
if err != nil {