Files
2026-10-06 22:45:35 +03:00

12 lines
365 B
Go

package dto
import "time"
// Timestamp preserves PostgreSQL microseconds and is readable by Python 3.9 clients.
// time.Time's variable-length fractional part is not supported by those clients.
type Timestamp time.Time
func (t Timestamp) MarshalJSON() ([]byte, error) {
return []byte(`"` + time.Time(t).UTC().Format("2006-01-02T15:04:05.000000Z") + `"`), nil
}