Total Pageviews

Friday, 18 December 2020

OAF : How to Add days in input date

 OAF : How to Add days in input date

import java.text.SimpleDateFormat;

import java.util.Calendar;

import java.text.ParseException;

public class Example{

   public static void main(String args[]){

        String oldDate = "2017-01-29"; 

               System.out.println("Date before Addition: "+oldDate);

               SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

               Calendar c = Calendar.getInstance();

               try{

                  c.setTime(sdf.parse(oldDate));

               }catch(ParseException e){

                  e.printStackTrace();

                }

               //Incrementing the date by 1 day

               c.add(Calendar.DAY_OF_MONTH, 1); 

               String newDate = sdf.format(c.getTime()); 

               System.out.println("Date Incremented by One: "+newDate);

   }

}


No comments:

Post a Comment

FUSION: Purchasing Query

  1) ---------CPA to PO Amount---------- select poh.segment1, (select sum(nvl(cpol.quantity,1)* cpol.unit_price) from po_headers_all cpoh,po...