summaryrefslogtreecommitdiff
path: root/formatTime.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-13 08:01:38 -0500
committerJeff Carr <[email protected]>2025-10-13 08:01:38 -0500
commitf386a0655a7147ba3e14da6bfd37b25ad5e0b151 (patch)
tree59b7942732b54b730354fbb97c173f2bd07b53e8 /formatTime.go
parent114f34291f856f61f9aa3089952862bea4d50dd0 (diff)
never need zones if you are always on universal time
Diffstat (limited to 'formatTime.go')
-rw-r--r--formatTime.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/formatTime.go b/formatTime.go
index 48e58fd..2cb0da9 100644
--- a/formatTime.go
+++ b/formatTime.go
@@ -9,6 +9,13 @@ import (
// there is only one way to display the time as text
// this is that way. Don't like it? Don't use COBOL
func FormatTime(t time.Time) string {
+ s := t.Format("2006/01/02 15:04:03")
+ dur := time.Since(t)
+ //always time, two spaces, (duration)
+ return s + " (" + FormatDuration(dur) + ")"
+}
+
+func FormatTimeLocal(t time.Time) string {
localTime := t.Local()
s := localTime.Format("2006/01/02 15:04:03")
dur := time.Since(t)