Merge pull request #8037 from AkihiroSuda/epoch-drop-timezone

pkg/epoch: drop timezone
This commit is contained in:
Phil Estes 2023-01-31 17:04:50 -05:00 committed by GitHub
commit 0181b103ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ func SourceDateEpoch() (*time.Time, error) {
if err != nil { if err != nil {
return nil, fmt.Errorf("invalid %s value %q: %w", SourceDateEpochEnv, v, err) return nil, fmt.Errorf("invalid %s value %q: %w", SourceDateEpochEnv, v, err)
} }
unix := time.Unix(i64, 0) unix := time.Unix(i64, 0).UTC()
return &unix, nil return &unix, nil
} }
@ -55,7 +55,7 @@ func SourceDateEpochOrNow() time.Time {
if epoch != nil { if epoch != nil {
return *epoch return *epoch
} }
return time.Now() return time.Now().UTC()
} }
// SetSourceDateEpoch sets the SOURCE_DATE_EPOCH env var. // SetSourceDateEpoch sets the SOURCE_DATE_EPOCH env var.