Here you can find the source of getCurrentTime2MysqlDateTime()
public static String getCurrentTime2MysqlDateTime()
//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 }