get Calendar for Display - Android java.util

Android examples for java.util:Calendar Format

Description

get Calendar for Display

Demo Code


//package com.java2s;

import java.util.Calendar;

import java.util.Locale;

public class Main {
    public static String getDateDisplay(Calendar cal) {
        return cal.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.US)
                + " " + cal.get(Calendar.DATE) + ", "
                + cal.get(Calendar.YEAR);
    }//from  w ww.  j  a  v a 2  s.c  om
}

Related Tutorials