When I've booted my Raspberry Pi 3 into Raspbian, I've setup the /etc/profile to load a program though mono. However, the program now reports the wrong time (An hour behind on the previous day), though testing, I've found that it only happens though loading the program at boot as running it though the command line after booting works fine. What am I doing wrong?
What am I doing wrong?
/etc/profile to run a boot service. But that's not the cause of this particular problem.
The Pi does not have a real time clock like standard computers. The system has no way of knowing the actual time when booted. Raspbian uses an NTP client to get the correct current time from the network, but obviously this requires a connection to a network and may take tens of seconds to complete, during which time your program has already started.
Prior to getting an update via NTP, the system either uses the Unix epoch as the time (you may notice files time stamped 1969 or 1970 because of this) or else a timestamp created by the OS during the last run (I am not sure of the details; I believe it should happen at shutdown).