get Short format Calendar value for Display - Android java.util

Android examples for java.util:Calendar Format

Description

get Short format Calendar value for Display

Demo Code


//package com.java2s;

import java.util.Calendar;

import java.util.Locale;

public class Main {
    public static String getShortDateDisplay(Calendar cal) {
        return cal
                .getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.US)
                + " " + cal.get(Calendar.DATE);
    }//from w  w  w. j a va  2s.  c  o m
}

Related Tutorials