Good Day!
I have a problem with SQL Dates. I think the main problem is on the perspective of time.
In my program, I have a start and end date, say for example
This is the code for timestamp datatype
Date d=new Date();
Timestamp t=new Timestamp(d.getTime());try{
PreparedStatement pt=con.prepareStatement("INSERT INTO survey_schedule (start_date) VALUES (?);");
pt.setTimestamp(1, start_date);
pt.executeUpdate();}
catch(Exception e)
{
System.out.println(e);
}
This is an example that will store the date and time in the mysql database