Here you can find the source of getCurrentTimeString(Context context)
Parameter | Description |
---|---|
context | a parameter |
public static String getCurrentTimeString(Context context)
//package com.java2s; import java.util.Date; import android.content.Context; import android.text.format.DateFormat; public class Main { /**//www . j a va 2 s . co m * format the time according to the current locale and the user's 12-/24-hour clock preference * * @param context * @return */ public static String getCurrentTimeString(Context context) { return DateFormat.getTimeFormat(context).format(new Date()); } }