diff options
| author | Jeff Carr <[email protected]> | 2025-10-12 03:32:26 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-12 03:32:26 -0500 |
| commit | aff745937b2c936f87cc48b82d0725f662bb1e30 (patch) | |
| tree | 374d37a352bb7e90f515db79bf7b41ea316c582b /formatTime.go | |
| parent | a32b88646c02fd785687cd2a498b56410e62b2cd (diff) | |
Standard Time(). Perfect place for this. I am pleased.
Diffstat (limited to 'formatTime.go')
| -rw-r--r-- | formatTime.go | 15 |
1 files changed, 15 insertions, 0 deletions
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) + ")" +} |
