Modifying the system time with the date command is invalid because you need to manually modify the system time zone so that the system can be correctly displayed.
You must manually modify the system time zone to display the correct time.
1.Find
Date and time of outputCal View calendar of the month Cal-y view year-round calendarModify the system time date-s "2014-12-30 13:23:23"Network update time Yum install-y NTPNtpdate ntp.fudan.edu.cn uses the time server of Fudan University to
Linux date command details
Usage:
Date [-u] [-D datestr] [-s datestr] [-- UTC] [-- Universal] [-- date = datestr] [-- set = datestr] [-- help] [-- version] [+ format] [mmddhhmm [[CC] YY] [. SS]
Note:
Date can be used to display or set the date and
Name: DatePermission: All UsersUsage: date [-u] [-D datestr] [-s datestr] [-- UTC] [-- Universal] [-- date = datestr] [-- set = datestr] [-- help] [-- version] [+ format] [mmddhhmm [[CC] YY] [. SS]Note: date can be used to display or set the date
When writing a Linux shell script, date is a frequently used command, this article makes a summary, in case you use to look everywhere1, the most basic, display the current specific period: directly into the date can, as below,[Email
Name: Date
Permission: All Users
Usage: Date [-u] [-D datestr] [-s datestr] [-- UTC] [-- Universal]
[-- Date = datestr] [-- set = datestr] [-- help] [-- version] [+ format]
[Mmddhhmm [[CC] YY] [. SS]
Note: date can be used to display or set the date
Want to add some task plan in root crontab, want to run command with WWW user, and redirect output to a log file named at that time, roughly as follows/usr/bin/sudo-u www/usr/local/php/bin/php/www/open/www.php &>/var/log/xxx_cron_log/www_$ (date + "%
First, IntroductionThe date in Liunx is a very common command used to display the modified time, as followsSecond, the syntax formatusage:date [OPTION] ... [+format]Iii. Common Options%y #显示年份的最后两位%Y #显示Full year%m #显示月份%M #显示分钟%h #显示月%H #显示小时%s #
Background:The items that are built daily are placed in different folders by date. As today's construction is put into 2015-06-01, tomorrow's will be put into 2015-06-02, and so on. Long time, need a script to delete the folder N days ago. (In this
Usage of the Linux Date commandIn Linux shell programming, the addition and subtraction of dates is often usedI used to use the expr function to calculate the problem.Actually, the date command itself provides the addition and subtraction of
Format: Date [options] ... [+ format]Option Description:-D,--date= string displays the time described by the specified stringFormat Description:Example 1:#!/bin/bash##1. Gets the current system time yyyy-mm-DD HH:MM:SSv_time_eq=`Date "+%f%T"'
The date command itself provides the addition and subtraction of datesFor example: Get yesterday's timeDate +%y%m%d--date= "-1 day" 1. In the display, the user can set the format to be displayed, formatted as a plus followed by a number of tokens,
Linux time modification does not restart modify time zone
First, the time to modify Linux
Root uses the date directive: Date-s
1, only modify the date, do not modify the time, input:
Linux Code
Date-s 2007-08-03
2, only modify the time, input:
First, Shell script introductionShell scripts to write well, you must continue to practice writing to write well, there is no shortcutTo have a general idea of a script when we get a demand, think of how the need to achieveShell scripting can
[[Email protected] shell]# date +%y year, 4-digit2018[[Email protected] shell]# date +%y year, 2-digit18[[Email protected] shell]# date +%m Month04[[Email protected] shell]# date +%m M, number of minutes57[[Email protected] shell]# date +%d13[Email
The content comes from BBS, which has been sorted out and shared!
Calculate the date 3 days ago
date +%D -d ‘-3 days‘11/03/12
Calculate the date after 3 days
date +%D -d ‘+3 days‘11/09/12
The date after 3 days is calculated. If you do not write +,
How to set the system time using the date command in Linux
Name: Date
Permission: All Users
Usage:
Date [-u] [-D datestr] [-s datestr] [-- UTC] [-- Universal][-- Date = datestr] [-- set = datestr] [-- help] [-- version] [+ format][Mmddhhmm [[CC] YY]
Date command and system time setting in CentOSLinux Clock is divided into System Clock and Real Time Clock (RTC. The system clock is the current Linux Kernel clock, and the hardware clock is the battery-powered clock on the motherboard. This
In Linux Shell programming, addition and subtraction of dates are often used.
Previously, it was very troublesome to use expr function computing.
In fact, the date command itself provides the addition and subtraction operation of the date
Very
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.