Format Time using date format from Context - Android android.content

Android examples for android.content:Context

Description

Format Time using date format from Context

Demo Code

import java.util.Date;

import android.content.Context;

public class Main{

    public static String toTime(Date date, Context context) {
        return android.text.format.DateFormat.getTimeFormat(context)
                .format(date);//from www  . j a v a  2  s  . c om
    }

}

Related Tutorials