pkg/epoch: drop timezone
For determinism of human-readable string representation. e.g., "2023-01-10T12:34:56Z" vs "2023-01-10T21:34:56+09:00" Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
parent
ee0e22f01c
commit
e551d734fb
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user