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
In PHP website development, the date and time fields in Mysql database design are essential because the date format output by Mysql date functions is not compatible with the date format between PHP date functions, in PHP website development, the
The date object is used to process the date and time.Syntax for creating a date object:VaR mydate = new date ()The date object automatically saves the current date and time as its initial value.The following five parameters are supported:
New date
One, time stamp conversion date1 functionformatdate (datetime) {2 //Slice (-2) filters out more than 0 in front of the 10th period when the month day is obtained3 varYear =datetime.getfullyear (),4Month = ("0" + (DateTime.)GetMonth()
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 | -
When building a station with Phpcms V9, the time tag is often used, it is the universal tag call-date time format, applicable to the whole station.1, Date time format display:A\ Standard type: {date (' y-m-d h:i:s ', $rs [' Inputtime '])} output: 201
On the Swagger UI model schema, the field date is displayed as "date": "2018-10-15t09:10:47.507z" but I need to use it as "date": "2018-9-26 12:18:48".Tips: The following two formats are just simple to understand a bit is not very comprehensive,
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.