How to output 'uptime' in days, hours and minutes?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
themanfrommoon
Normal user
Posts: 48
Joined: 23 May 2017, 21:38
Location: Malente / Germany

How to output 'uptime' in days, hours and minutes?

#1 Post by themanfrommoon » 09 May 2018, 10:26

Hi,

The uptime is shown in the web interface as follows:
0 days 19 hours 50 minutes

But if I would like to display the uptime on a display using "Uptime: %uptime%min" then it shows only in minutes.

So how to display the uptime on a display with days, hours and minutes?

(If it is too long it also could be shown like 0d 19h 50m)

Thanks and best regards,
Chris

danmero
Normal user
Posts: 64
Joined: 11 May 2017, 01:19

Re: How to output 'uptime' in days, hours and minutes?

#2 Post by danmero » 09 May 2018, 11:48

Take a look at Wiki > System Variables.

Regards,

themanfrommoon
Normal user
Posts: 48
Joined: 23 May 2017, 21:38
Location: Malente / Germany

Re: How to output 'uptime' in days, hours and minutes?

#3 Post by themanfrommoon » 09 May 2018, 13:52

Hi danmero,

Yes I did, but I only found: %uptime% -> Uptime in minutes

I'm searching for a solution for uptime like this: 0d 19h 50m

Thank you and best regards,
Chris

Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: How to output 'uptime' in days, hours and minutes?

#4 Post by Micha_he » 09 May 2018, 14:53

Maybe

%c_m2dhm%(%uptime%)

Look at formula section.

But in my opinion, there is an error with 'missing' target-minutes. The formula for 'day-hour' and for 'day-hour-minutes' in the wiki syntax, are the same :?:

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: How to output 'uptime' in days, hours and minutes?

#5 Post by grovkillen » 09 May 2018, 16:11

Fixed, thanks!!
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

themanfrommoon
Normal user
Posts: 48
Joined: 23 May 2017, 21:38
Location: Malente / Germany

Re: How to output 'uptime' in days, hours and minutes?

#6 Post by themanfrommoon » 10 May 2018, 12:43

Hi,

Thanks a lot, this works:

%c_m2dhm%(%uptime%)

Just another small question:

Is it possible to change the display from "0d19h40m" to "0d 19h 40m" (added a space between the single values)

Thanks a lot an best regards,
Chris

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: How to output 'uptime' in days, hours and minutes?

#7 Post by grovkillen » 10 May 2018, 14:15

That's something that needs to be done in the source. Add a feature request on GitHub.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests