From aff745937b2c936f87cc48b82d0725f662bb1e30 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 12 Oct 2025 03:32:26 -0500 Subject: Standard Time(). Perfect place for this. I am pleased. --- formatTime.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 formatTime.go (limited to 'formatTime.go') diff --git a/formatTime.go b/formatTime.go new file mode 100644 index 0000000..2dcc3c2 --- /dev/null +++ b/formatTime.go @@ -0,0 +1,15 @@ +package cobol + +import ( + "time" +) + +// 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 { + localTime := t.Local() + s := localTime.Format("2006/01/02 15:04:03") + dur := time.Since(t) + //always time, two spaces, (duration) + return s + " (" + FormatDuration(dur) + ")" +} -- cgit v1.2.3