java中的date插入到mysql的datetime中的方法 发表于 2016-07-29 | 分类于 后台 | 123456789101112131415package com.hundsun;import java.sql.Timestamp;import java.util.Date;/** * Created by zeewane on 2016/7/29/0029. */public class DateDemo { public static void main(String[] args) { Date date = new Date(); Timestamp timestamp = new Timestamp(date.getTime()); System.out.println(timestamp);//2016-07-29 16:28:44.526 }}