Java Date Now getCurrentTime2MysqlDateTime()

Here you can find the source of getCurrentTime2MysqlDateTime()

Description

get Current Time Mysql Date Time

License

Open Source License

Declaration

public static String getCurrentTime2MysqlDateTime() 

Method Source Code

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

public class Main {
    public static String getCurrentTime2MysqlDateTime() {
        java.util.Date dt = new java.util.Date();

        java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        String currentTime = sdf.format(dt);
        return currentTime;
    }// w  w w .j av a 2  s  . com
}

Related

  1. getCurrentTime(String pattern)
  2. getCurrentTime(String pattern)
  3. getCurrentTime(String pattern)
  4. getCurrentTime(String pattern)
  5. getCurrentTime(String timeFormat)
  6. getCurrentTimeAndDate()
  7. getCurrentTimeAsNumber()
  8. getCurrentTimeAsString()
  9. getCurrentTimeForFileName()