Hello everyone, here is one problem I am facing while using java.util.Date() class.
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
sdf.format(new java.util.Date());
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
sd.format(new java.util.Date());
Statement stmt = Conn.createStatement(); // Conn object is already created
String query = "select sum(ctotal) from creg where date_time between '"+sd.format(new java.util.Date())+"' and '"+sdf.format(new java.util.Date())+"'";
ResultSet rs = stmt.executeQuery(query);
if(rs.next())
{
totalCash = rs.getFloat(1);
}
Here in this code, I'm not getting the proper value for "new java.util.Date()" when using
JSP with Tomcat5.5 (jakarta-tomcat-5.5.9)??
I cant trace what's the exact problem.
All suggestion are welcome !
Thanks.