forum

Home / DeveloperSection / Forums / How to Select days between two datetime in android?

How to Select days between two datetime in android?

Anonymous User194206-Nov-2014
I have two datetime 09/01/2014 and 09/10/2014.i want to check days between there datetimes. i wrote function witch can to change datetime format

publicstaticString dateFormatterforLukka(String inputDate)
        {
 
            String inputFormat = "MM/dd/yyyy";
            String outputFormat = "d MMM";
 
            Date parsed = null;
            String outputDate = "";
            try
            {
                SimpleDateFormat df_input = new SimpleDateFormat(inputFormat,
                        new Locale("en", "US"));
                SimpleDateFormat df_output = new SimpleDateFormat(outputFormat,
                        new Locale("en", "US"));
 
 
                parsed = df_input.parse(inputDate);
                outputDate = df_output.format(parsed);
            }
            catch (Exception e)
            {
                outputDate = inputDate;
            }
            return outputDate;
        }

but i do not know how i can solve my problem if anyone knows solution please help me


Updated on 07-Nov-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By