calendar Time String as MM-dd HH:mm format - Android java.util

Android examples for java.util:Hour

Description

calendar Time String as MM-dd HH:mm format

Demo Code


//package com.java2s;

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

public class Main {
    public static String calendar2TimeString(Calendar calendar) {
        SimpleDateFormat format = new SimpleDateFormat("MM-dd HH:mm");
        return format.format(calendar.getTime());
    }//from  www.  ja v a 2 s  .  c  om
}

Related Tutorials