Linux Time Modify--date-s command

Source: Internet
Author: User

Linux Time modification does not restart modify time zone

One, time to modify Linux
Root uses the date directive: Date-s
1, only modified date, no modification time, input:
Linux code

    1. Date-s 2007-08-03  

date-s 2007-08-03


2, modify time only, enter:
Linux code

    1. Date-s 14:15:00  

date-s 14:15:00


3, modify datetime, note double quotation marks, a space between date and time, enter:
Linux code

   1. Date-s "2007-08-03 14:15:00"   

date-s "2007-08-03 14:15:00"



4, after the modification, remember to enter:
Linux code

   1. clock-w   

clock-w


Write system time to CMOS


Second, modify time zone does not restart
under root
1, copy the appropriate time zone file, replace the system time zone file:
Linux code

   1. CP/ usr/share/zoneinfo/$ Primary time zone/$ time zone/etc/localtime  

cp/usr/share/zoneinfo/$ Primary time zone/$ secondary time zone/etc/localtime


For example:
Linux code

   1. cp/usr/share/zoneinfo/asia/shanghai/etc/localtime   

Cp/usr/share/zoneinfo/asia/shanghai/etc/localtime

Linux time Modify--date-s command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.