mirror of
https://github.com/easychen/pushdeer.git
synced 2025-02-23 00:14:56 +08:00
修正时间显示(+0前缀)
This commit is contained in:
parent
4fbf408eae
commit
0808c2257c
@ -140,7 +140,9 @@ void loop() {
|
|||||||
void show_time(bool force)
|
void show_time(bool force)
|
||||||
{
|
{
|
||||||
timeClient.update();
|
timeClient.update();
|
||||||
newTime = String(timeClient.getHours()) + ':' + String(timeClient.getMinutes()) ;
|
String hourStr = timeClient.getHours() < 10 ? "0" + String(timeClient.getHours()) : String(timeClient.getHours());
|
||||||
|
String minStr = timeClient.getMinutes() < 10 ? "0" + String(timeClient.getMinutes()) : String(timeClient.getMinutes());
|
||||||
|
newTime = hourStr + ":" + minStr ;
|
||||||
if( lastTime != newTime )
|
if( lastTime != newTime )
|
||||||
{
|
{
|
||||||
echo_time( newTime );
|
echo_time( newTime );
|
||||||
|
@ -324,7 +324,9 @@ void clear_config()
|
|||||||
void show_time(bool force)
|
void show_time(bool force)
|
||||||
{
|
{
|
||||||
timeClient.update();
|
timeClient.update();
|
||||||
newTime = String(timeClient.getHours()) + ':' + String(timeClient.getMinutes()) ;
|
String hourStr = timeClient.getHours() < 10 ? "0" + String(timeClient.getHours()) : String(timeClient.getHours());
|
||||||
|
String minStr = timeClient.getMinutes() < 10 ? "0" + String(timeClient.getMinutes()) : String(timeClient.getMinutes());
|
||||||
|
newTime = hourStr + ":" + minStr ;
|
||||||
if( lastTime != newTime )
|
if( lastTime != newTime )
|
||||||
{
|
{
|
||||||
echo_time( newTime );
|
echo_time( newTime );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user