In Controller
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.text.DateFormat;
import java.util.Date;
String newProjStartDate,newProjEndDate, sConvertNewStartDate, sConvertNewEndDate = null;
newProjStartDate= (String)pageContext.getSessionValue("newstartdate");
newProjEndDate= (String)pageContext.getSessionValue("newenddate");
try
{
DateFormat formatter ;
Date date, date1, date2, date3;
formatter = new SimpleDateFormat("yyyy-MM-dd");
date = formatter.parse(newProjStartDate);
date1 = formatter.parse(newProjEndDate);
pageContext.writeDiagnostics(this, "date is =" + date, 1);
pageContext.writeDiagnostics(this, "date1 is =" + date1, 1);
SimpleDateFormat formatterNew = new SimpleDateFormat("dd-MMM-yyyy");
sConvertNewStartDate=formatterNew.format(date);
sConvertNewEndDate=formatterNew.format(date1);
pageContext.writeDiagnostics(this, "sConvertStartDate date is =" + sConvertNewStartDate, 1);
pageContext.writeDiagnostics(this, "sConvertEndDate date1 is =" + sConvertNewEndDate, 1);
}
catch (ParseException e)
{
throw new IllegalArgumentException("Encountered Date format error "+ e);
}
Subscribe to:
Post Comments (Atom)
Implemting Google Drive File Uploader using OAuth
Implementing Google Drive Text File Uploader using OAuth 2.0 Creating Project and Registering your API with Google In this part we wil...
-
What it is? AngularJS is a very powerful JavaScript Framework. It is used in Single Page Application (SPA) projects. It extends HTML DOM ...
-
Technology today is so evolving. The purpose of keyboard keys fulfilled by bananas. https://youtu.be/3LmaCkczLcU
-
Implementing Google Drive Text File Uploader using OAuth 2.0 Creating Project and Registering your API with Google In this part we wil...
No comments:
Post a Comment