> This function is made for the formatting of *dates*, not *time intervals.
>
> That would mean that you might get even funnier results if your uptime
> is more than (around) 30-31 days.
I did understand. For now my chromebook uptime is over 30 days, thanks!
Sincerely, Byung-Hee.
--
^고맙습니다 _白衣從
In Article <17430759904711630...@scdbackup.webframe.org>,
"Thomas Schmitt" writes:
> [...]
> (You should better compute the time interval days from the seconds
> difference. %d will probably rollover at 31.)
Thank you for good point, indeed;;;
Sincerely, Byung-Hee.
--
^고맙습니다 _白衣從軍_ 감사합니다_^)
Hi,
Byung-Hee wrote:
> uptime = Time.at(uptime_data).utc.strftime("%d days %H:%M")
> Ruby: 28 days 09:23 (Tue Sep 26 15:19:58 +0900 2017)
> Bash: 00:43:33 up 27 days, 9:23, 0 users, load average: 0.01, 0.10, 0.21
Google sent me to
https://apidock.com/ruby/DateTime/strftime
My guess is that
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Tue, Oct 24, 2017 at 12:50:03AM +0900, Byung-Hee HWANG (황병희, 黃炳熙) wrote:
> #+BEGIN_SRC ruby
> require "date"
>
> uptime_data = IO.read('/proc/uptime').split[0].to_i
> sboot = Time.now - uptime_data
>
> if uptime_data >= 86400
> uptime = Time
4 matches
Mail list logo