Hello everybody. First of all , I want to thank you for all the great informations posted on this forum !
I made this post because I am working to an app using node red, and I don't really now how to proceed with this :
My app(made with node-red) is running on a Raspberry Pi (main server). This app, it will be accessed and used from a Phone. The problem with Raspberry Pi is the fact that he doesnt keep his clock , so everytime I need to set manually with date command ( my app don
t require internet connection in order to set the date automatically with ntp) .
Does everybody know a node or a java Script function which interogate the correct hour and date from the Phone, in order to synchronize the date and hour to Raspbbery Pi?
Till know I tried something like this : Using a function node with the code :
function upTime() {
var d = new Date();
msg.payload=d;
}
return msg;
This function code it returns the epoch format number which I can use it forward to set the date and time for Raspbeery Pi with exec node. But, the problem is THIS NUMBER IS THE EPOCH FORMAT NUMBER from the Raspber Pi, not from the PHONE.
I need somehow to take the correct data and time informations from the PHONE and synchronize with Raspberry PI. Maybe another functions, I don`t know.
If anybody of you have an idea how to fix this, just let me know.
Thanks in advance.