Local Test Cases:
# there can be no spaces on either side of the equal sign, before the error has been out here
yesterday= ' date-d last-day +%y-%m-%d '
echo $yesterday
curday= ' Date +%y-%m-%d '
echo $curday
echo "Now time: ' Date ' +%y%m%d%T '"
Date--helpUsage: date [options] ... [+ format]Or: Date [-u|--utc|--universal] [MMDDHHMM[[CC]YY][.SS]]Displays the current time in the given format, or sets the system date.-D,--date= string displays the time described by the specified string, not
Date of the Linux command I used-Display, modify system date TimeThis article link: http://codingstandards.iteye.com/blog/1157513 (reproduced please specify the source)Description of UseThe ATE command can be used to display and modify the system
Description of UseThe ATE command can be used to display and modify the system datetime, noting that it is not a time command.Common parametersFormat: DateDisplays the current date time.Format: Date mmddhhmmFormat: Date mmddhhmmyyyyFormat: Date
Help information for the date command[root@localhost source]# date--helpusage: date [options] ... [+ format]or: Date [-u|--utc|--universal] [MMDDHHMM[[CC]YY][.SS]]Displays the current time in the given format, or sets the system date. -D,--date=
Date command Arguments
-d,–date=string Displays the time specified by STRING-f,–file=datefile A similar –date parameter to display the time per line in a Datefile file-itimespec,–iso-8601[=timespec] Displays the date/time in ISO 8601 format.
Display time is a commonly used command. It is often used to display date-related file names or times in shell scripts. The date command is used in both Linux and Windows.
Date command usage in Linux
Date [Option]… [+ Format]
Date [-u | -- UTC | -
Time and date It is usually possible to determine the time and date pair
Program It is very useful. The program may want to record its running time, or may need to change its running mode in some cases. For example, a game may refuse to run during
Linuxdate format time and date [root @ brief test ~] Date-dtoday + & quot; % Y-% m-% d & quot; 2008-05-07 [root @ brief test ~] Date-dtoday + & quot; % Y _ %-m _ %-d & quot; 2008_5_7 [root @ brief test ~ Linux date formatting time and date [root @ 10
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.