Commit 5948549c authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Added unix time format function

- Robert Anderson <randerson@lbsd.net>
parent 3e65a368
......@@ -40,5 +40,23 @@ function renderUsageFloat(val) {
return val.toFixed(2);
}
function formatUnixTimestamp(v,f) {
if (v) {
// Check if we have a format
if (!f) {
return v;
}
// Working with seconds
var dt = new Date();
dt.setTime(v * 1000);
return dt.format(f);
} else {
return;
}
}
// vim: ts=4
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment