Present times in configured timezone

This commit is contained in:
Magnus Åhall 2024-07-04 16:54:23 +02:00
parent 0de7ca4bef
commit fefd4af10c

View File

@ -54,14 +54,14 @@ func (dp DatapointValue) Value() any { // {{{
} }
if dp.ValueDateTime.Valid { if dp.ValueDateTime.Valid {
return dp.ValueDateTime.Time return dp.ValueDateTime.Time.In(smonConfig.timezoneLocation)
} }
return nil return nil
} // }}} } // }}}
func (dp DatapointValue) FormattedTime() string { // {{{ func (dp DatapointValue) FormattedTime() string { // {{{
if dp.ValueDateTime.Valid { if dp.ValueDateTime.Valid {
return dp.ValueDateTime.Time.Format("2006-01-02 15:04:05") return dp.ValueDateTime.Time.In(smonConfig.timezoneLocation).Format("2006-01-02 15:04:05")
} }
return "invalid time" return "invalid time"
} // }}} } // }}}