blob: 2cb0da9fa5cc7f4bb4c167c0bc2579fb688662f1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
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 {
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)
//always time, two spaces, (duration)
return s + " (" + FormatDuration(dur) + ")"
}
|