Short answer. Use:
You can use the
uptime command to find out how long it has been since the Pi (or any Unix/Linux OS) has booted. The
-s flag tells uptime to calculate the boot time.
The Pi doesn't have a real-time clock (though there are RTC chips that you can add). This means it does not know the date/time as it boots. If it has access to a network, it'll reach out to a time server to set these. But if it doesn't have a network, it will rely on a fake hardware clock (basically a file where it periodically writes the time. It isn't accurate but at least it fixes problems where log files have "newer" entries with older date/time stamps than "older" entries.
See: How is time kept on the Raspberry Pi?