From 441edd4c01e158275039db882bf6b18d6f3fba8d Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Thu, 19 Apr 2018 01:06:33 -0400 Subject: Adding time.Since and time.Until wrappers Signed-off-by: Dave Henderson --- funcs/time.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'funcs') diff --git a/funcs/time.go b/funcs/time.go index 111b0b23..d1030cab 100644 --- a/funcs/time.go +++ b/funcs/time.go @@ -143,6 +143,16 @@ func (f *TimeFuncs) ParseDuration(n interface{}) (gotime.Duration, error) { return gotime.ParseDuration(conv.ToString(n)) } +// Since - +func (f *TimeFuncs) Since(n gotime.Time) gotime.Duration { + return gotime.Since(n) +} + +// Until - +func (f *TimeFuncs) Until(n gotime.Time) gotime.Duration { + return gotime.Until(n) +} + // convert a number input to a pair of int64s, representing the integer portion and the decimal remainder // this can handle a string as well as any integer or float type // precision is at the "nano" level (i.e. 1e+9) -- cgit v1.2.3