Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: display %syshour% %sysmin% %syssec% as integers with leading 0 #2991

Closed
bccrew opened this issue Apr 7, 2020 · 7 comments
Closed
Labels
Type: Documentation Type: Not a bug Issues that later appeared not to be a bug (e.g. user error)

Comments

@bccrew
Copy link
Contributor

bccrew commented Apr 7, 2020

Hello,

I like to have my LCD2004 in dutch language and for time annotation we like to use "15u00" for 3PM.

According to the documentation https://www.letscontrolit.com/wiki/inde ... _Variables the notation should be like this:

%syshour% Current hour (hh)
%sysmin% Current minute (mm)

When I use the following line in the LCD2004 config:

%sysweekday_s% %sysday%/%sysmonth%/%sysyear% %syshour%u%sysmin%

the notation is 0u1 instead of 00u01 what I'm expecting.

Suggestion: display hours, minutes, and seconds under value of 10 as 01, 02 , 03, 04 etc.

CFR: https://www.letscontrolit.com/forum/viewtopic.php?p=43729#p43729

@TD-er
Copy link
Member

TD-er commented Apr 8, 2020

The variables you want, are already present as can be seen on the system variables page:

variable value URL-encoded
%sysyear% // %sysyear_0% 2020 // 2020 2020 // 2020
%sysyears% 20 20
%sysmonth% // %sysmonth_0% 4 // 04 4 // 04
%sysday% // %sysday_0% 8 // 08 8 // 08
%syshour% // %syshour_0% 9 // 09 9 // 09
%sysmin% // %sysmin_0% 3 // 03 3 // 03
%syssec% // %syssec_0% 27 // 27 27 // 27
%syssec_d% 32607 32607
%sysweekday% 4 4
%sysweekday_s% Wed Wed

For example %syssec_0%

@TD-er TD-er added Type: Documentation Type: Not a bug Issues that later appeared not to be a bug (e.g. user error) labels Apr 8, 2020
@bccrew
Copy link
Contributor Author

bccrew commented Apr 8, 2020

Hi TD-er,

Ok, so just the documentation needs to be updated then. Thanks!

https://www.letscontrolit.com/wiki/index.php/ESPEasy_System_Variables

@thomastech
Copy link
Contributor

Ok, so just the documentation needs to be updated then.

[x] Done.
I updated the wiki to include the missing system vars.

BTW, the %sysyear_0% var is amusing. Would have been useful a few centuries ago.

  • Thomas

@bccrew
Copy link
Contributor Author

bccrew commented Apr 8, 2020

OK, thanks Thomas!

@bccrew bccrew closed this as completed Apr 8, 2020
@TD-er
Copy link
Member

TD-er commented Apr 8, 2020

BTW, the %sysyear_0% var is amusing. Would have been useful a few centuries ago.

Well we plan on a long running project :)
At least it is more useful than the code present at one of my previous jobs, where there was actual code for milli bits, micro bits and nano bits.

@uzi18
Copy link
Contributor

uzi18 commented Apr 8, 2020

milli bits, micro bits and nano bits

how to add 10micro bits to 100 nano bits ? :)

@TD-er
Copy link
Member

TD-er commented Apr 8, 2020

milli bits, micro bits and nano bits

how to add 10micro bits to 100 nano bits ? :)

Or even better, multiply them :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Type: Not a bug Issues that later appeared not to be a bug (e.g. user error)
Projects
None yet
Development

No branches or pull requests

4 participants