Android Time Get getCurrentTimeStr()

Here you can find the source of getCurrentTimeStr()

Description

get Current Time Str

Declaration

public static String getCurrentTimeStr() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;
import java.util.Locale;

public class Main {
    private final static SimpleDateFormat dateFormater = new SimpleDateFormat(
            "yyyy-MM-dd HH:mm:ss", Locale.CHINA);

    public static String getCurrentTimeStr() {
        return getTimeStr(System.currentTimeMillis());
    }//from  w  w w .j  a va2 s  .  c o  m

    public static String getTimeStr(long time) {
        return dateFormater.format(new Date(time));
    }
}

Related

  1. getTimeString(String strTime)
  2. getNowDateTime()
  3. getTimeAsInt()
  4. nowAsTime()
  5. getCurrentTimeCalendar()
  6. getCurrentTimeString()
  7. getTime()
  8. getTime()
  9. getCurrentlyDateTime()