1

When I run the last command on one of my Raspberry Pi's running Raspbian I get this at the end:

wtmp begins Thu Jan  1 01:00:01 1970

When I run the last command on a proper operating system, such as Ubuntu or Fedora I get a real date, not the epoch time. What's causing it and what does in mean (in both cases).

2

You are seeing this because the wtmp file is rotated at the 1st of each month. (e.g. wtmp is moved to wtmp.1 and a new wtmp is created empty).

In the Raspberry PI, as you do not have a Real Time Clock to keep the time, each time you (re)boot it you are back to Epoch 0 which is Jan 1, 1970.

The good news is that you can buy an RTC (DS3231) for the Raspberry in AliExpress for less than 2 Euros, or in Europe for around 5-10 Euros The Pi Hut. I myself bought one for my Lamobo R1 and another one for my rpi 3.

see Adding a Real Time Clock to your Raspberry Pi

As a side note, if having an Internet connection, the rpi is supposed to get back in time sometime after booting via the NTP protocol; however having an RTC means it will get back in time earlier in the bootup sequence; also the RTC is particularly handy for Raspberries/Arduinos that are not connected to the Internet.

RTC

1
  • You are welcome. While installing it can be bumpy on some rpi chinese clone boards, I can confirm it works pretty well. – Rui F Ribeiro May 29 '17 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.