Convert Java Date to Mysql Date

Normal 0 21 false false false MicrosoftInternetExplorer4

public static String toMysqlDateStr(Date date){

if (date==null)

return "NULL";

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

return '\''+sdf.format(date)+'\'';



Popular posts from this blog

Get Remote IP Address In Axis SOAP Server

Connect via SSH without a password from MacOS to Linux with an SSHKEY