Add, subtract, and format dates in Linux

Source: Internet
Author: User
In Linux, add or subtract the date and format it. run the code www.2cto.com to format the system date to yyyymmdd and subtract the day. 1. java code: date + & quot; % B % e, % G & quot;-d & amp; #39;-1day & amp; #39; 2. use the Java code CUR in the shell script...
In Linux, add or subtract the date and format it. run the code www.2cto.com to format the system date to yyyymmdd and subtract the day. 1. java code date + "% B % e, % G"-d '-1 day' 2. use the Java code CURR_DATE = 'date + "% B % e, % G"-d '-1 day' in the shell script. Note that the format is enclosed by quotation marks, remember to add back quotation marks to the command, indicating the result of referencing this command!
Reference: http://www.2cto.com/ OS /201211/166759.html

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.