Skip to content

Commit

Permalink
Time format.
Browse files Browse the repository at this point in the history
To quote Oracle “Month name-Day-Year with no leading zeros”.
  • Loading branch information
KacperPerschke committed Nov 5, 2024
1 parent d200566 commit 1eae56c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion artifactory/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ func (l LicenseInfo) TypeNormalized() string {
return strings.ToLower(l.Type)
}

const USAFullDate = "Jan 2, 2006"

func (l LicenseInfo) ValidSeconds() (int64, error) {
if l.IsOSS() {
return 0, nil
}
validThroughTime, err := time.Parse("Jan 2, 2006", l.ValidThrough)
validThroughTime, err := time.Parse(USAFullDate, l.ValidThrough)
if err != nil {
return 0, fmt.Errorf(
"unparsable ‘validThrough’ license field: %w",
Expand Down

0 comments on commit 1eae56c

Please sign in to comment.