2019-03-13 04:14:30 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
type tempus struct {
|
|
|
|
props *properties
|
|
|
|
env environmentInfo
|
|
|
|
}
|
|
|
|
|
|
|
|
const (
|
2020-11-12 00:43:32 -08:00
|
|
|
// TimeFormat uses the reference time Mon Jan 2 15:04:05 MST 2006 to show the pattern with which to format the current time
|
2019-03-13 04:14:30 -07:00
|
|
|
TimeFormat Property = "time_format"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (t *tempus) enabled() bool {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *tempus) string() string {
|
|
|
|
timeFormatProperty := t.props.getString(TimeFormat, "15:04:05")
|
|
|
|
return time.Now().Format(timeFormatProperty)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *tempus) init(props *properties, env environmentInfo) {
|
|
|
|
t.props = props
|
|
|
|
t.env = env
|
|
|
|
}
|