clock fix

This commit is contained in:
Yuri Trikoz
2020-06-27 04:20:48 +03:00
parent 39a3cb04ed
commit 7ac0691347
7 changed files with 69 additions and 74 deletions

View File

@@ -113,7 +113,7 @@ class Clock {
* Локальное время "дд.ММ.гг"
*/
const String getDateDigitalFormated() {
char buf[16];
char buf[32];
sprintf(buf, "%02d.%02d.%02d", _time_local.day_of_month, _time_local.month, _time_local.year);
return String(buf);
}
@@ -122,16 +122,22 @@ class Clock {
* Локальное время "чч:мм:cc"
*/
const String getTime() {
char buf[16];
char buf[32];
sprintf(buf, "%02d:%02d:%02d", _time_local.hour, _time_local.minute, _time_local.second);
return String(buf);
}
const String getTimeJson() {
char buf[32];
sprintf(buf, "%02d-%02d-%02d", _time_local.hour, _time_local.minute, _time_local.second);
return String(buf);
}
/*
* Локальное время "чч:мм"
*/
const String getTimeWOsec() {
char buf[16];
char buf[32];
sprintf(buf, "%02d:%02d", _time_local.hour, _time_local.minute);
return String(buf);
}