Set up scheduled program cycles #24
@@ -10,8 +10,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[env:esp32doit-devkit-v1]
 | 
					[env:esp32doit-devkit-v1]
 | 
				
			||||||
platform = espressif32
 | 
					platform = espressif32
 | 
				
			||||||
;build_flags =
 | 
					build_flags =
 | 
				
			||||||
;	-std=c++11
 | 
						-std=c++11
 | 
				
			||||||
;	-std=gnu++11
 | 
					;	-std=gnu++11
 | 
				
			||||||
board = esp32doit-devkit-v1
 | 
					board = esp32doit-devkit-v1
 | 
				
			||||||
framework = arduino
 | 
					framework = arduino
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -79,11 +79,14 @@ const char index_html[] PROGMEM = R"rawliteral(
 | 
				
			|||||||
      current_start = new Date(s * 1000);
 | 
					      current_start = new Date(s * 1000);
 | 
				
			||||||
      //current_start_utc = current_start.toUTCString();
 | 
					      //current_start_utc = current_start.toUTCString();
 | 
				
			||||||
      document.getElementById('current-start').innerHTML = current_start.toString();
 | 
					      document.getElementById('current-start').innerHTML = current_start.toString();
 | 
				
			||||||
 | 
					      // Show the local time
 | 
				
			||||||
 | 
					      local_time_unix = new Date().toString(); //Math.floor(Date.now() / 1000) - new Date().getTimezoneOffset()*60;
 | 
				
			||||||
 | 
					      document.getElementById('local-time-unix').innerHTML = local_time_unix.toString();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  </script></head><body>
 | 
					  </script></head><body>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <p>Local time: <b>%inputTimeUnix%</b></p>
 | 
					  <p>Local time: <b><span id=local-time-unix></span></b></p>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <form action="/get" target="hidden-form" onsubmit="putDate(this);" accept-charset=utf-8>
 | 
					  <form action="/get" target="hidden-form" onsubmit="putDate(this);" accept-charset=utf-8>
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
@@ -105,7 +108,7 @@ const char index_html[] PROGMEM = R"rawliteral(
 | 
				
			|||||||
    </select></p>
 | 
					    </select></p>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <p>Program start time <input type="datetime-local" id="js_start_time_unix_entry" /><br>
 | 
					    <p>Program start time <input type="datetime-local" id="js_start_time_unix_entry" /><br>
 | 
				
			||||||
    Current value: <b><span id = current-start></span></b>)
 | 
					    Current value: <b><span id=current-start></span></b>
 | 
				
			||||||
    <!-- JS converts the entered start time to a unix timestamp, and copies that value
 | 
					    <!-- JS converts the entered start time to a unix timestamp, and copies that value
 | 
				
			||||||
    to this hidden field so the user doesn't have to see it. -->
 | 
					    to this hidden field so the user doesn't have to see it. -->
 | 
				
			||||||
    <input type="hidden" name="inputStartTimeUnix" id="js_start_time_unix" /></p>
 | 
					    <input type="hidden" name="inputStartTimeUnix" id="js_start_time_unix" /></p>
 | 
				
			||||||
@@ -209,8 +212,10 @@ String processor(const String& var){
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
  else if(var == "inputFloat"){
 | 
					  else if(var == "inputFloat"){
 | 
				
			||||||
    return readFile(SPIFFS, "/inputFloat.txt");
 | 
					    return readFile(SPIFFS, "/inputFloat.txt");
 | 
				
			||||||
  } else if(var == "inputTimeUnix"){
 | 
					  // } else if(var == "inputTimeUnix"){
 | 
				
			||||||
    return rtc.now().timestamp();
 | 
					  //   //return rtc.now().timestamp();
 | 
				
			||||||
 | 
					  //   Serial.print("RTC time: ");    
 | 
				
			||||||
 | 
					  //   Serial.println(rtc.now().unixtime());
 | 
				
			||||||
  } else if(var == "inputStartTimeUnix"){
 | 
					  } else if(var == "inputStartTimeUnix"){
 | 
				
			||||||
    return readFile(SPIFFS, "/inputStartTimeUnix.txt");
 | 
					    return readFile(SPIFFS, "/inputStartTimeUnix.txt");
 | 
				
			||||||
  } 
 | 
					  } 
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user