Files
mtusi2026lab2/app/internal/common/helpers.go
T

18 lines
283 B
Go

package common
import (
"encoding/json"
"time"
)
type RFCFormTime time.Time
func (t RFCFormTime) MarshalJSON() ([]byte, error) {
ftime := time.Time(t).UTC().Format(time.RFC3339)
return json.Marshal(ftime)
}
func NowUTC() RFCFormTime {
return RFCFormTime(time.Now().UTC())
}