Software /
code /
prosody
Comparison
plugins/mod_uptime.lua @ 3540:bc139431830b
Monster whitespace commit (beware the whitespace monster).
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sat, 16 Oct 2010 23:00:42 +0500 |
parent | 3232:c47bfd62701c |
child | 4345:f6d694b1cdb3 |
comparison
equal
deleted
inserted
replaced
3539:8bbd965267b2 | 3540:bc139431830b |
---|---|
32 local minutes = t%60; | 32 local minutes = t%60; |
33 t = (t - minutes)/60; | 33 t = (t - minutes)/60; |
34 local hours = t%24; | 34 local hours = t%24; |
35 t = (t - hours)/24; | 35 t = (t - hours)/24; |
36 local days = t; | 36 local days = t; |
37 return string.format("This server has been running for %d day%s, %d hour%s and %d minute%s (since %s)", | 37 return string.format("This server has been running for %d day%s, %d hour%s and %d minute%s (since %s)", |
38 days, (days ~= 1 and "s") or "", hours, (hours ~= 1 and "s") or "", | 38 days, (days ~= 1 and "s") or "", hours, (hours ~= 1 and "s") or "", |
39 minutes, (minutes ~= 1 and "s") or "", os.date("%c", prosody.start_time)); | 39 minutes, (minutes ~= 1 and "s") or "", os.date("%c", prosody.start_time)); |
40 end | 40 end |
41 | 41 |
42 function uptime_command_handler (self, data, state) | 42 function uptime_command_handler (self, data, state) |
43 return { info = uptime_text(), status = "completed" }; | 43 return { info = uptime_text(), status = "completed" }; |