format Date to string in d MMMM yyyy format - Android java.util

Android examples for java.util:Date Format

Description

format Date to string in d MMMM yyyy format

Demo Code

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main{
    private static SimpleDateFormat FORMATTER = new SimpleDateFormat(
            "d MMMM yyyy");
    public static String formatDate(Date date) {
        return FORMATTER.format(date);
    }/*from www  .ja  va 2 s .  c  o m*/

}

Related Tutorials