Format long value Date To String in MM/dd/yy h:mmaa format - Android java.util

Android examples for java.util:Date Convert

Description

Format long value Date To String in MM/dd/yy h:mmaa format

Demo Code

import android.text.format.DateFormat;
import java.util.Calendar;

public class Main{

    public static CharSequence DateToString(long time) {
        return DateFormat.format("MM/dd/yy h:mmaa", time);
    }/*from   ww  w . ja  va  2 s .  c  om*/

}

Related Tutorials