android days between two datetimes -
I have two days 09/01/2014 and 09/10/2014. I want to check the day between the day. I have written that the function witch can change that-time format
public static string dateFormatary look (string inputdate) {string input format = "mm / dd / yy"; String output = format = "d MMM"; Date pars = zero; String output = "" = "; {SimpleDateFormat df_input = New SimpleDateFormat (Input Format, New Locale ("N", "US")); SimpleDateFormat df_output = New SimpleDateFormat (Output Format, New Locale ("N", "US")); Parse = df_input.pars (inputdate); Outputdata = df_output.format (parsed); } Hold (exception e) {outputDate = inputDate; } Return the output output; } But I do not know if someone knows me how can I solve my problem, please help me
< You can try this function:
public string getDateDiffString (date of one date, date date two) {div class = "post-text" itemprop = "text" Long time = 1One.getTime (); Long two = date tau time (); Long aca = 1000 * 60 * 60 * 24; Long delta = (time two time - time) / acre; If (delta> gt;) {return "date two" + delta + "day after day"; } And {delta * = -1; Return "Date Two" + Delta + "Day First Day"; }}
Comments
Post a Comment