[linux] Adjust Time

We use the command below to find out the current system time:

date


If it's incorrect and we wish to change it, we can issue a command below:

date nnddhhmm[[cc]yy][.ss]


where

    nn = month of the year (01 to 12)
    dd = day of the month (01 to 31)
    hh = hour of the day (00 to 23)
    mm = minute of the hour (00 to 59)
    cc = The first to digits of the year
    yy = The last two digits of the year
    .ss = The seconds

Here's the command to find out the hardware clock:

hwclock --show


To make it consistent with the system time, command like this:

hwclock --hctosys


If we wanna keep it on time automatically, install ntp.

你可能感兴趣的:(java,linux)