Java Date Now getCurrentDateTime()

Here you can find the source of getCurrentDateTime()

Description

get Current Date Time

License

Apache License

Declaration

public static Date getCurrentDateTime() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;
import java.util.*;

public class Main {

    public static Date getCurrentDateTime() {
        return Calendar.getInstance().getTime();
    }//from w  w  w. j  ava2  s  .c  o m

    public static String getTime() {
        Date currentTime = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String dateString = formatter.format(currentTime);
        String min;
        min = dateString.substring(14, 16);
        return min;
    }
}

Related

  1. getCurrentDateTime()
  2. getCurrentDateTime()
  3. getCurrentDateTime()
  4. getCurrentDateTime()
  5. getCurrentDateTime()
  6. getCurrentDateTime()
  7. getCurrentDateTime()
  8. getCurrentDateTime(String dateFormat)
  9. getCurrentDateTime(String format)