Get date in n days

From , 5 Years ago, written in Java, viewed 96 times.
URL https://pastebin.vip/view/9461cce2
  1. import java.util.*;
  2. import java.text.*;
  3.  
  4. public class Test {
  5.         public static void main(String[] args) {
  6.                 GregorianCalendar worldTour = new GregorianCalendar();
  7.                 worldTour.add(GregorianCalendar.DATE, 100); // 当前日期加100天
  8.                 Date d = worldTour.getTime();
  9.                 DateFormat df = DateFormat.getDateInstance();
  10.                 String s = df.format(d);
  11.                 System.out.println("100天后的日期是:" + s);
  12.         }
  13. }
  14.  

Reply to "Get date in n days"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website