Android Calendar Get getCurrentTimeStr()

Here you can find the source of getCurrentTimeStr()

Description

get Current Time Str

License

Open Source License

Declaration

public static String getCurrentTimeStr() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    private static final String PARSE_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";

    public static String getCurrentTimeStr() {
        SimpleDateFormat dateFormat = new SimpleDateFormat(
                PARSE_DATE_FORMAT);//from  w w  w  .  java2s . co m
        Date d = new Date(System.currentTimeMillis());
        return dateFormat.format(d);
    }
}

Related

  1. GetCurrentTime_String()
  2. GetCurrentTime_UTCMilliSeconds()
  3. GetCurrentTime_UTCSeconds()
  4. getCurrentMonth()
  5. getCurrentWeek()
  6. getCurrentWeek()
  7. getCurrentWeek(Calendar cal)
  8. getDate()