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.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {
    private static final DateFormat dateFormatting = new SimpleDateFormat(
            "MM-dd-yyyy_HH:mm:ss");
    private static final Calendar calendar = Calendar.getInstance();

    public static String getCurrentTime() {
        return dateFormatting.format(calendar.getTime());
    }// www .jav a 2s.co  m
}

Related

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