Posted By:
Anonymous
Posted On:
Monday, December 3, 2007 04:37 AM
import java.sql.*;
import java.text.*;
public class Test
{
public static void main(String args[])throws Exception
{
java.util.Date d1= new java.util.Date();
System.out.println(d1);
String z="4/20/2007";
SimpleDateFormat sd2= new SimpleDateFormat("M/d/yy");
java.util.Date d3=null;
try
{
d3=sd2.parse(z);
System.out.println(d3);
}
catch(Exception e)
{
System.out.println(e);
}
System.out.println(d3.getDay());
}
}
Re: plz plz help (URGENTLY REQUIRED)
Posted By:
Anonymous
Posted On:
Wednesday, November 28, 2007 07:27 AM
The d3.getDay() has been depricated thtswhy it is showing the Jan.
Thanks & Regards
Jyoti Biaksh Panda
Motherson Sumi Infotech & Designs Ltd.
Noida
jyoti.panda@mind-infotech.com
Re: plz plz help (URGENTLY REQUIRED)
Posted By:
Robert_Lybarger
Posted On:
Friday, November 16, 2007 08:09 PM
Lowercase "m" in format pattern means "minutes". You probably meant uppercase "M" for "month". In effect, you built a pattern such that "z" parsed to january 16 207 at 11 minutes past midnight.