blob: 48e58fd7b97b37bef6732555d792c5fb462c5fa6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
package cobol
// time is relative. keep it that way.
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) + ")"
}
|