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...
-
Spring Boot makes it easier to build Spring based applications by focusing on convention over configuration. Following standard Spr...
-
Implementing Google Drive Text File Uploader using OAuth 2.0 Creating Project and Registering your API with Google In this part we wil...
-
<?php ob_start(); include '../connection.php'; $branch22 = $_POST['item83']; $course22 = $_POST['item88']; ...
No comments:
Post a Comment