@@ -513,16 +513,25 @@ void parseSystemVariables(String& s, boolean useURLencode)
513
513
// valueString is being used by the macro.
514
514
char valueString[5 ];
515
515
#define SMART_REPL_TIME (T,F,V ) if (s.indexOf(T) != -1 ) { sprintf_P (valueString, (F), (V)); repl ((T),valueString, s, useURLencode);}
516
- SMART_REPL_TIME (F (" %syshour%" ), PSTR (" %02d" ), hour ())
517
- SMART_REPL_TIME (F (" %sysmin%" ), PSTR (" %02d" ), minute ())
518
- SMART_REPL_TIME (F (" %syssec%" ),PSTR (" %02d" ), second ())
516
+ SMART_REPL_TIME (F (" %sysyear%" ), PSTR (" %d" ), year ())
517
+ SMART_REPL_TIME (F (" %sysmonth%" ),PSTR (" %d" ), month ())
518
+ SMART_REPL_TIME (F (" %sysday%" ), PSTR (" %d" ), day ())
519
+ SMART_REPL_TIME (F (" %syshour%" ), PSTR (" %d" ), hour ())
520
+ SMART_REPL_TIME (F (" %sysmin%" ), PSTR (" %d" ), minute ())
521
+ SMART_REPL_TIME (F (" %syssec%" ),PSTR (" %d" ), second ())
519
522
SMART_REPL_TIME (F (" %syssec_d%" ),PSTR (" %d" ), ((hour ()*60 ) + minute ())*60 + second ());
520
- SMART_REPL_TIME (F (" %sysday%" ), PSTR (" %02d" ), day ())
521
- SMART_REPL_TIME (F (" %sysmonth%" ),PSTR (" %02d" ), month ())
522
- SMART_REPL_TIME (F (" %sysyear%" ), PSTR (" %04d" ), year ())
523
- SMART_REPL_TIME (F (" %sysyears%" ),PSTR (" %02d" ), year ()%100 )
524
523
SMART_REPL (F (" %sysweekday%" ), String (weekday ()))
525
524
SMART_REPL (F (" %sysweekday_s%" ), weekday_str ())
525
+
526
+ // With leading zero
527
+ SMART_REPL_TIME (F (" %sysyears%" ),PSTR (" %02d" ), year ()%100 )
528
+ SMART_REPL_TIME (F (" %sysyear_0%" ), PSTR (" %04d" ), year ())
529
+ SMART_REPL_TIME (F (" %syshour_0%" ), PSTR (" %02d" ), hour ())
530
+ SMART_REPL_TIME (F (" %sysday_0%" ), PSTR (" %02d" ), day ())
531
+ SMART_REPL_TIME (F (" %sysmin_0%" ), PSTR (" %02d" ), minute ())
532
+ SMART_REPL_TIME (F (" %syssec_0%" ),PSTR (" %02d" ), second ())
533
+ SMART_REPL_TIME (F (" %sysmonth_0%" ),PSTR (" %02d" ), month ())
534
+
526
535
#undef SMART_REPL_TIME
527
536
}
528
537
SMART_REPL (F (" %lcltime%" ), getDateTimeString (' -' ,' :' ,' ' ))
0 commit comments