diff options
| author | Jeff Carr <[email protected]> | 2025-10-14 07:52:32 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-14 07:52:32 -0500 |
| commit | bf5891a4c983fd4300ed57d1e42a0e0dca72fea4 (patch) | |
| tree | 4bfbad9b5f08e9c33f01c903e2792c23b68a9714 /time.string.go | |
| parent | 92e9b066f424c8e8055c01365bbd5e45e3c4f1b4 (diff) | |
no using log herev0.0.22
Diffstat (limited to 'time.string.go')
| -rw-r--r-- | time.string.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/time.string.go b/time.string.go index 595fb4f..b3aa166 100644 --- a/time.string.go +++ b/time.string.go @@ -8,7 +8,7 @@ import ( ) func doTimeString(BUILDTIME string) (*time.Time, error) { - parts := strings.Split(BUILDTIME, ".") + parts := strings.Split(BUILDTIME, " ") if len(parts) == 1 { // The input epoch seconds // epochSeconds := int64(1758646486) @@ -22,5 +22,16 @@ func doTimeString(BUILDTIME string) (*time.Time, error) { t := time.Unix(epochSeconds, 0) return &t, errors.New("treated string as seconds") } + if len(parts) >= 2 { + if len(parts[0]) == 10 && len(parts[1]) == 8 { + // log.Info("GOT HERE also", BUILDTIME) + const layout = "2006/01/02 15:04:05" + t, err := time.ParseInLocation(layout, parts[0]+" "+parts[1], time.UTC) + if err == nil { + return &t, nil + } + + } + } return nil, NewFeature } |
