Java Time Now getNowTime(String formatStr)

Here you can find the source of getNowTime(String formatStr)

Description

get Now Time

License

Open Source License

Declaration

public static String getNowTime(String formatStr) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String getNowTime() {
        return new SimpleDateFormat("HHmmss").format(new Date());
    }/*from  w  w w.j a va2  s .co  m*/

    public static String getNowTime(String formatStr) {
        return new SimpleDateFormat(formatStr).format(new Date());
    }
}

Related

  1. getNowTime()
  2. getNowTime()
  3. getNowTime()
  4. getNowTime(String format)
  5. getNowTime(String format, Locale loc)
  6. getNowWithLocal(boolean ifdatetime)
  7. getNowYearMonth()
  8. getNowYMD()
  9. getSpecifiedDateTime_235959(Date curDate)