Raspberry Pi 3 - how to set date back to 1970 on start?

  • Hi

    With LibreElec on Raspberry Pi 3, is it possible to set the date/time on/after booting?

    I have recently changed from OpenElec to LibreElec and now whenever the system boots it starts at time 3:58am 23rd June 2016. Previously with OpenElec the system would boot at 12am 01-01-1970 and this was useful because it was easy to see how long the system had been on (the Pi is not on a network so the system time doesn't update).

    Thanks

  • It's possible that the RPi's firmware was updated and along with that the starting datetime was altered.

    "and this was useful because it was easy to see how long the system had been on"
    Really...? The RPi you bought somewhere between 2014 and 2016, that has an initial datetime of January 1970, will tell you its proper uptime? It's really beyond me why such an inconclusive statistic would be useful.


  • It's possible that the RPi's firmware was updated and along with that the starting datetime was altered.

    "and this was useful because it was easy to see how long the system had been on"
    Really...? The RPi you bought somewhere between 2014 and 2016, that has an initial datetime of January 1970, will tell you its proper uptime? It's really beyond me why such an inconclusive statistic would be useful.

    The 1970 isn't relevant, but starting at 12am is convenient as it means my wife can check how long the kids have been watching videos just by looking at the top right of the screen.
    [hr]


    Why not just check the system uptime with the "uptime" command?

    Convenience really - if a movie is playing, then moving the mouse pops up (amongst other things) the time and pressing escape hides it. This takes all of 2 seconds and doesnt disturb the kids watching and is within the technical ability of my computer illiterate wife. If the time on system startup is always 12am and she sees it is past 3am then she knows its time for the kids to be doing something else :)

    Edited once, last by sento (October 23, 2016 at 8:23 AM).

  • Is that intended as humor or sarcasm? I cant tell.
    [hr]
    A solution turned out to be quite easy once I stopped thinking about setting the time and and googled for running a process on startup up instead.

    For anyone interested, my solution was to create an 'autostart.sh' file and add the command: date -s '1980-01-01 12:00:00'
    It wouldn't work with 1970, but as I was more interested in having the time starting at 12, this works for my purposes.

    Info on autostart.sh found here: Autostart.sh - OpenELEC

    Edited once, last by sento (October 23, 2016 at 10:25 AM).