100 days after the current time date, formatted as XXXX year XX month XX day

Source: Internet
Author: User
Tags getdate

 PackageCom.demo1;ImportJava.text.SimpleDateFormat;ImportJava.util.Calendar;Importjava.util.Date; Public classDemo9 { Public Static voidMain (string[] args) {Date date=NewDate (); System.out.println (getDate (date,100)); }     Public StaticString getDate (date date,intDay ) {        //Format Time Tool classSimpleDateFormat sdf=NewSimpleDateFormat ("yyyy mm month DD Day"); //million calendar get objectsCalendar calendar=calendar.getinstance (); //set the time to pass in the parameterscalendar.settime (date); //+ 100 DaysCalendar.add (calendar.day_of_month,100); //get + 100 days after dateDate tmp=Calendar.gettime (); //convert to specified below formatString day100=Sdf.format (TMP); //return        returnday100; }    }

100 days after the current time date, formatted as XXXX year XX month XX day

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.