This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

date command not working on SDK 7.0, Linux kernel 3.12

I tried to change the date on the AM335x evm board today.  I am using SDK 7.0,. kernel 3.12.  This was the results:

root@am335x-evm:~# date +%Y%m%d -s "20150207"
20190815
root@am335x-evm:~# date
Thu Aug 15 02:07:06 UTC 2019
root@am335x-evm:~#


Is there a known issue with the date command?

  • Hey Tim,

    Add the hour and minutes to the command. as in:

    date +%Y%m%d -s "201502070000"
  • Tim,
    Here is the rational for adding the hours and minutes.

    The 7.0 SDK uses the "date" command from BusyBox.
    It supports the following formats:
    "hh:mm[:ss]"
    "[YYYY.]MM.DD-hh:mm[:ss]"
    "YYYY-MM-DD hh:mm[:ss]"
    "[[[[[YY]YY]MM]DD]hh]mm[.ss]"

    For example
    date -s "2015-02-08 08:11:55" sets the time and date correctly.

    Now, the "[[[[[YY]YY]MM]DD]hh]mm[.ss]" is interesting. I think you have to start with the minutes (mm) and build from there.

    date -s "1233" would be 12 hours and 33 minutes. So in order to get yours to work you need to do the following:
    date -s "201502070000"