[Solved] Create a function that takes string object and returns Date object in dd-MM-yyyy format [duplicate]

I have done lot of research over web, but I got solution from one Expert. Date getDateFrmString(String dDate) { java.sql.Date dDate = new java.sql.Date(new SimpleDateFormat(“yyyy-MM-dd”).parse(sDate).getTime()); return dDate; } this is what I want. solved Create a function that takes string object and returns Date object in dd-MM-yyyy format [duplicate]

[Solved] Android – change Date format to – dd.mm.yyyy HH:mm [duplicate]

At First Post Your Code . Please follow How do you format date and time in Android Code for SimpleDateFormat . Just check the logic . SimpleDateFormat timeStampFormat = new SimpleDateFormat(“dd-yyyy-MM HHmm”); Date GetDate = new Date(); String DateStr = timeStampFormat.format(GetDate); Now replace – as . DateStr = DateStr.replace(“-“, “.”); solved Android – change Date … Read more