This code can helps us to separate Time from Date.
String d="1-2-2010 3:43:57 PM";
DateFormat formatterDateFormat;
Date date;
formatterDateFormat=new SimpleDateFormat("yyyy-MM-dd H:mm:ss");
date=(Date)formatterDateFormat.parse(d);
DateFormat df=DateFormat.getTimeInstance(DateFormat.SHORT);
String time=df.format(date);
System.out.println("Time is ... "+time);
Output of this code is like...
Time is ... 3:43 PM
/*********************************************************************
* METHOD NAME :sendPasswordENotification()
* PUROPOSE :Send Mail
* CREATED BY :DAGADU AKAMBE
* CREATED ON :--
* MODIFIED BY :--
*********************************************************************/
public void sendEMail(String firstName,String lastName,String middleName,String emailId,String userPassword)
{
/*********************************************************************
* METHOD NAME :sendPasswordENotification()
* PUROPOSE :Send Mail
* CREATED BY :DAGADU AKAMBE
* CREATED ON :--
* MODIFIED BY :--
*********************************************************************/
tcEmailNotificationUtil sendMail = new tcEmailNotificationUtil(dataProvider);
sendMail.setBody("Welcome to OIM. Your name:"+lName+" "+fName+" "+mName+". Your password: "+password+"");
sendMail.setSubject("***Welcome to OIM! Your Password.***");
sendMail.setFromAddress("touseremailaddress");
sendMail.sendEmail(recipient);