# proto: google.protobuf.Timestamp: seconds value out of range

- **ID:** `go/protobuf-timestamp-out-of-range`
- **Domain:** go
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A google.protobuf.Timestamp was constructed with seconds outside the valid range [-62135596800, 253402300799], typically from a zero time.Time or a Unix timestamp in milliseconds.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.x | active | — | — |

## Workarounds

1. **** (93% success)
   ```
   Use timestamppb.New(t) which converts time.Time correctly, and validate t.IsZero() before conversion; for unset use a nil *timestamppb.Timestamp instead of zero.
   ```
2. **** (90% success)
   ```
   Convert from milliseconds explicitly: ts := timestamppb.New(time.UnixMilli(ms)) so the seconds/nanos split is correct.
   ```

## Dead Ends

- **** — Seconds must be in seconds; milliseconds overflow the valid range and produce an out-of-range error. (90% fail)
- **** — time.Time{}.Unix() is a large negative number that may fall outside the valid proto range depending on the year. (70% fail)
