Looking at this Time Arduino library because I would like to send time stamps with data across my HC05-PC channel.
https://playground.arduino.cc/Code/Time
I wrote this function to get the time at any point
String getTime() {
String timeSecond = String(second());
String timeMinute = String(minute());
String timeHour = String(hour());
String timeDay = String(day());
String timeMonth = String(month());
String timeYear = String(year());
String now = timeHour + ":" + timeMinute + ":" + timeSecond + " " +
timeMonth + "/" + timeDay + "/" + timeYear;
return now;
}
It seems in the docs he provides info on how to set the default time on a Linux/Unix system so that this library will always be grabbing the correct time by editing some bash files.
When I run the function, having been compiled on Windows, it begins running on 1/1/1970 0:0:0.
He does not provide any documentation for setting the Windows time stamp. How would I go about doing that?