mirror of
https://github.com/prometheus/prometheus
synced 2024-12-29 10:12:26 +00:00
Merge pull request #831 from prometheus/fix-time-utc
Switch human-readable times to UTC.
This commit is contained in:
commit
9d7fa930ce
@ -242,7 +242,7 @@ func NewTemplateExpander(text string, name string, data interface{}, timestamp c
|
||||
if math.IsNaN(v) || math.IsInf(v, 0) {
|
||||
return fmt.Sprintf("%.4g", v)
|
||||
}
|
||||
t := clientmodel.TimestampFromUnixNano(int64(v * 1000000000)).Time()
|
||||
t := clientmodel.TimestampFromUnixNano(int64(v * 1e9)).Time().UTC()
|
||||
return fmt.Sprint(t)
|
||||
},
|
||||
"pathPrefix": func() string {
|
||||
|
@ -142,7 +142,7 @@ func TestTemplateExpansion(t *testing.T) {
|
||||
{
|
||||
// HumanizeTimestamp - clientmodel.SampleValue input.
|
||||
text: "{{ 1435065584.128 | humanizeTimestamp }}",
|
||||
output: "2015-06-23 15:19:44.128 +0200 CEST",
|
||||
output: "2015-06-23 13:19:44.128 +0000 UTC",
|
||||
},
|
||||
{
|
||||
// Title.
|
||||
|
@ -37,7 +37,7 @@
|
||||
{{end}}
|
||||
</td>
|
||||
<td><span class="alert alert-{{ .State | alertStateToClass }} state_indicator">{{.State}}</span></td>
|
||||
<td>{{.ActiveSince.Time}}</td>
|
||||
<td>{{.ActiveSince.Time.UTC}}</td>
|
||||
<td>{{.Value}}</td>
|
||||
<td><a href="#" class="silence_alert_link">Silence…</a></td>
|
||||
</tr>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Uptime</th>
|
||||
<td>{{.Status.Birth}}</td>
|
||||
<td>{{.Status.Birth.UTC}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
Loading…
Reference in New Issue
Block a user