Format Calendar as MM-dd - Android java.util

Android examples for java.util:Hour

Description

Format Calendar as MM-dd

Demo Code


//package com.java2s;

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

public class Main {
    public static String date3() {
        SimpleDateFormat format = new SimpleDateFormat("MM-dd");
        Calendar c = Calendar.getInstance();
        String date = format.format(c.getTime());
        return date;
    }/*from  w w  w .  j a  va2s .co m*/
}

Related Tutorials