TX2 modify the display time

Hi,
When TX2 is not connected to the network or does not use RTC battery, the time displayed by date command is the time of the Flash system time, How to modify this time?

Use timedatectl.

hi, WayneWWW
Unable to save time after power failure with timedatectl command,
Where is the configuration file that records the time?
After use flash.sh script to flash the system, the tx2 default system time is changed to the local time of the host, I want to modify the configuration file directly.

Check if hwclock command can help.

Hi,
Thanks for the previous advice. I’m still a little confused about the time displayed by the date command.
TX2 is not connected to the network yes, the display time is 2021.7.22 L4T R32.6.1,
This should have been added when you released R32.6.1.
I want to change the default time. Can you give me some suggestions

Hi,

What is the “timedatectl” result now?

Hi,
Local time :四 2021-07-22 02:52:16 CST
Univerdal time :三 2021-07-21 18:52:16 UTC
RTC time: 六 2000-01-01 01:00: 51
Time zone: Asia/Shanghai
System clock synchronized : no
system-timesyncd.service active: no
RTC in local TZ :no

So if you reboot the device, the time will always be back to 2021-07-22 no matte you set to something else before reboot?

yes, it is true

Is this issue reproducible on devkit?

I tested it with the Nano DevKit and the results were the same

Hi,
Is there a solution?

Does the board still have power supply provided after your so-called reboot/power off?

After the software is shut down, disconnect the power supply and then power it on again.

Hi,

Then I don’t think it is a bug… it is normal that system time would be gone… if no power supply and also no RTC.

Hi,
Yes, I know ,we just want to change the system’s default time and not use RTC to save the clock.
According to the default time shown by Date, I think you added the default time when you released the system.
I would like to know how to modify the system time so that it will be displayed after being powered on.

Hi,
Can RTC initial time 2000-01-01 be changed?

Still checking with internal team about this.

Hi,
Thank you very much. If you hear of something, let me know.

Hi,

The time logic here is

  1. It will check the timestamp of file /var/lib/systemd/timesync/clock
  2. If that’s earlier then the systemd compile time, it will use systemd compile time. Otherwise clock file timestamp will be used.

Thus, please put the timestamp you want to see in /var/lib/systemd/timesync/clock.