Java Date Now getCurrentTime()

Here you can find the source of getCurrentTime()

Description

get Current Time

License

Open Source License

Declaration

public static String getCurrentTime() 

Method Source Code


//package com.java2s;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

public class Main {

    public static String getCurrentTime() {
        Calendar calendar = Calendar.getInstance(Locale.CHINESE);
        calendar.setTimeInMillis(new Date().getTime());
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
        return dateFormat.format(calendar.getTime());
    }/*from w w w  .  j a  va 2s .co  m*/
}

Related

  1. getCurrentTime()
  2. getCurrentTime()
  3. getCurrentTime()
  4. getCurrentTime()
  5. getCurrentTime()
  6. getCurrentTime()
  7. getCurrentTime()
  8. getCurrentTime()
  9. getCurrentTime(Date _d)