3

About reporting and settings for date and time exists available the date and timedatectl commands - it according with the most common results available through the web. Practically both do the same.

So when for an explicit scenario(s) one would be mandatory over the other?

3 Answers 3

4

There is one important difference:

When you set a time with the date command then only system time is changed. But if you set a time with the timedatectl then both system time and default rtc time is affected.

If you want update rtc time after the date change then you need to use hwclock.

2

date is an old UNIX tool, timedatectl is a new tool by systemd creators, so it's only available in distros with systemd.

Use whatever you like whenever it's available.

1

date is a part of GNU coreutils, it is available on all Linux systems, it is frequently used in scripting.

timedatectl is a part of systemd.

The two tools are used to set/display time and date.

see : info date, man timedatectl

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .