Android Time Get getCurrentTime()

Here you can find the source of getCurrentTime()

Description

get Current Time

Declaration

@SuppressLint("SimpleDateFormat")
    public static String getCurrentTime() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;
import android.annotation.SuppressLint;

public class Main {
    @SuppressLint("SimpleDateFormat")
    public static String getCurrentTime() {
        Date date = new Date(System.currentTimeMillis());
        SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");

        String text = sdf.format(date);

        return text;
    }//from  w w  w  . j ava 2 s. c  o  m
}

Related

  1. now()
  2. getTimeStamp()
  3. getTimeString(long time)
  4. getTimestamp()
  5. getCurrentTime()
  6. getCurrentTimeStamp()
  7. getNow()
  8. getNow()
  9. now()