Java Date Now getCurrentDateTime()

Here you can find the source of getCurrentDateTime()

Description

get Current Date Time

License

Apache License

Declaration

public static String getCurrentDateTime() 

Method Source Code


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

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

public class Main {
    public static String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd hh:mm:ss";

    public static String getCurrentDateTime() {
        SimpleDateFormat sdf = new SimpleDateFormat(DEFAULT_DATE_TIME_FORMAT);
        return sdf.format(new Date());
    }// ww w .j a  va 2 s  .co m
}

Related

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