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

Escape HTML and XML in Java

Read and Write Files in Java