Getdate from datepicker android?

You should use SimpleDateFormat. Format to convert that Date object to a String like this.

You should use SimpleDateFormat. Format to convert that Date object to a String, like this SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String dateString = sdf. Format(date1); I think you just had it backwards.

You need to use format to go from Date to String, and parse to go from a String to a Date.

Changed the code like this Date date1= (Date) new Date(dpBirthDate.getYear(), dpBirthDate.getMonth(), dpBirthDate.getDayOfMonth()); dates =new SimpleDateFormat("yyyy-MM-dd"). Format(date1); and what I got 3911-12-07 whats wrong – Aymen Taarit Dec 7 at 1:08 Well then check what the year of the Date object is before you pass it in – Craigy Dec 7 at 1:12 how can I fix the Date format please help! I always get the date strats with 3911 – Aymen Taarit Dec 8 at 20:21 Then you are creating the Date object incorrectly.As I said, you should debug what the value actually is.

If you look at the documentation of Date you see that the year you pass in must be "the year minus 1900", so that is probably your error. Java's Date object has to be handled with care. – Craigy Dec 8 at 20:39 thank you now its clear I should do 3911 -1900 to get the proper year 2011 – Aymen Taarit Dec 8 at 20:42.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions