Android Calendar Format getFormatedDate(Calendar c, String format)

Here you can find the source of getFormatedDate(Calendar c, String format)

Description

get Formated Date

Declaration

public static String getFormatedDate(Calendar c, String format) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Main {
    public static String getFormatedDate(Calendar c, String format) {
        try {/*www .  j a v a  2 s  . co  m*/
            Date d = new Date(c.getTimeInMillis());
            SimpleDateFormat dateFormat = new SimpleDateFormat(format);
            return dateFormat.format(d);
        } catch (Exception e) {
            return new String();
        }
    }
}

Related

  1. getFormattedTime(Context context, Calendar time)
  2. getFormattedTime(Context context, Calendar time)
  3. calendar2string(Calendar calendar, String formatString)
  4. format(Calendar cal, String format, Locale locale)
  5. getCalendarFromDateString(String dateString, String format, Locale locale)
  6. string2calendar(String s, String formatString)
  7. toSimpleDate(Calendar calendar, String format)
  8. getCurrentDateString(String dateFormat)
  9. getAsString(Calendar date)