get Short Month Year Display for Calendar - Android java.util

Android examples for java.util:Month

Description

get Short Month Year Display for Calendar

Demo Code


//package com.java2s;

import java.util.Calendar;

import java.util.Locale;

public class Main {
    public static String getShortMonthYearDisplay(Calendar cal) {
        return cal
                .getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.US)
                + " " + cal.get(Calendar.YEAR);
    }/*from  w  w  w. ja  va 2 s .co  m*/
}

Related Tutorials