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 2014-01-08
and 2014-01-10
.
In the datebase, I used datetime so the dates are stored as 2014-01-08 00:00:00
and 2014-01-10 00:00:00
respectively.
If you are a user and today is the end date, you would assume that the deadline is up to midnight. However, that is not the case because the hours, minutes, and seconds are set to 0.
I would like to ask, what is the best way to add the hours, minutes, and seconds so that the end date is up to midnight.
PS. I am using Java Sql Date.
INSERT INTO survey_schedule (start_date, end_date) VALUES (startDate, endDate);
startDate and endDate are java.sql.date
types
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…