App to convert DateTime to UNIX Timestamp and Sends it to NodeMCU

I need a solution, where we can update a certain string (a UNIX timestamp) to NodeMCU that has RTC Connected. If I schedule time in an app it takes the UNIX timestamp and updates it on the NodeMCU. So, it can work on scheduled time even without the internet. So I'm looking for an app to schedule the DateTime that converts a UNIX Timestamp and how to update it remotely, without using any third-party servers.

Why do you need an app? I didn't get that. Why not have the nodemcu update the RTC from an NTP server when connected to internet and use the RTC when not connected?

The concept is time scheduling (kind of alarm trigger). If I set a time and save it in the app. The time will be sent to NodeMCU and it is stored locally (EEPROM). So, I can compare the time and turn ON/OFF the device according to the time that I set on the App. In this way, it eliminates the Server, Poor internet connectivity issues that lead to failure of turning ON the device on time.

Ah, so the app is not setting the current time, it is setting up an alarm time or on/off time. The nodeMCU will get the current time from the RTC? Sorry, I found your first post quite confusing.

You can still do this without an app. The nodeMCU can host a simple web page through which the alarm or on/off times can be set. The nodeMCU can act as an Access Point so that your phone can connect to it to view the web page and set up or change the timers.

The nodeMCU has no EEPROM, but it can use some of its flash memory as file storage. You can store the scheduled on/off times in a file, which can be updated through the web page and read into memory at startup.

and in what programing language you create the scheduler app? I am sure it has a way to return 'epoch' time

PaulRB:
You can still do this without an app. The nodeMCU can host a simple web page through which the alarm or on/off times can be set. The nodeMCU can act as an Access Point so that your phone can connect to it to view the web page and set up or change the timers.

Great! I got a nearest possible solution. But it has to work outside the LAN. The time needs to be updated from any remote locations.

sarathkumar341:
But it has to work outside the LAN.

When the nodeMCU is acting as an Access Point, it creates a LAN, which your phone can connect to.

PaulRB:
When the nodeMCU is acting as an Access Point, it creates a LAN, which your phone can connect to.

Is there any way to update the UNIX timestamp on URL and can parse it on NodeMCU (Like an API). I needed it to control "Outside" the LAN. That's where I got stuck.

You must explain what you need in more detail, because I can't understand from your question. Give some examples use cases.

PaulRB:
You must explain what you need in more detail, because I can't understand from your question. Give some examples use cases.

All I need is a 'Unix Timestamp' (1576747566) to be sent to NodeMCU from an app or a webpage or any possible cost-effective way. In Youtube Videos URL, If you put ?t=42. It will play from 42 Seconds of the video. It happens because of API that takes values from the URL and returns back its functionality. In this I don't need the returning factor, The value I append in URL (Eg: 192.168.1.1/mytest?=1576747566) should reach NodeMCU & I extract the Timestamp from URL and store it.

Example for API calls on Youtube that starts an example video from 52 seconds of it: Google Assistant using Raspberry Pi | FactoryForward - YouTube

Using the stored value, I can control my device ON & OFF by comparing it with local RTC Unix Timestamps of every 24 Hours (Daily trigger).

I am familiar with the use of parameters in URLs. Yes, you can use these to send data to the nodeMCU. The nodeMCU can act as a web server, receiving requests, parsing the URL for the parameters, extracting them and storing or acting upon them.

What I don't understand is why you want to use unix time stamp for this. If the scheduled timer is repeated every day, the unix time stamp will be different every day, so you will need to give different timestamps for every day into the future. It would seem much more sensible to specify the time as hours and minutes (and perhaps seconds) and have the nodeMCU compare these to the RTC time.

sarathkumar341:
I needed it to control "Outside" the LAN.

You cannot connect your phone using WiFi where there is no LAN. But if you set up the nodeMCU as an Access Point, a LAN is created, as I mentioned in post #8.