summaryrefslogtreecommitdiff
path: root/unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'unix.go')
-rw-r--r--unix.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/unix.go b/unix.go
index 7e295e8..b1fcff7 100644
--- a/unix.go
+++ b/unix.go
@@ -274,7 +274,19 @@ func readFileToString(filename string) (string, error) {
return strings.TrimSpace(string(data)), nil
}
-func getDateStamp(raw string) (time.Time, string, string) {
+// converts a git for-each-ref date. "Wed Feb 7 10:13:38 2024 -0600"
+func getGitDateStamp(gitdefault string) (time.Time, string, string) {
+ // now := time.Now().Format("Wed Feb 7 10:13:38 2024 -0600")
+ const gitLayout = "Mon Jan 2 15:04:05 2006 -0700"
+ tagTime, err := time.Parse(gitLayout, gitdefault)
+ if err != nil {
+ log.Warn("GOT THIS IN PARSE AAA."+gitdefault+".AAA")
+ log.Warn(err)
+ return time.Now(), "Feb 1 12:34:56 1978 -0600", ""
+ }
+ return tagTime, gitdefault, getDurationStamp(tagTime)
+}
+func getRawDateStamp(raw string) (time.Time, string, string) {
parts := strings.Split(raw, " ")
if len(parts) == 0 {
// raw was blank here