Android Context Get getCurrentTimeString(Context context)

Here you can find the source of getCurrentTimeString(Context context)

Description

format the time according to the current locale and the user's 12-/24-hour clock preference

Parameter

Parameter Description
context a parameter

Declaration

public static String getCurrentTimeString(Context context) 

Method Source Code

//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());
    }
}

Related

  1. getString(Context context, int resId, Map replacement)
  2. getStringFromXml(Context context, int resId)
  3. getBoolean(ContentValues alarm, String key)
  4. findOne(Context context, Uri uri)
  5. getCurrentTimeString(Context aContext, long aDate)
  6. readRaw(Context ctx, int res_id)
  7. loadImageFromAsset(Context context, String id)
  8. hasTelephony(@Nonnull Context context)
  9. getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs)