
java.sql.Timestamp ts2 = java.sql.Timestamp.valueOf("2012-01-11 12:34:39"); long l=ts2.getTime() +(100060602424);//add 24 days Date d=new Date(l); System.out.println(d);
output=Sat Feb 04 12:34:39 IST 2012 //correct
java.sql.Timestamp ts2 = java.sql.Timestamp.valueOf("2012-01-11 12:34:39"); long l=ts2.getTime() +(100060602424);//add 25 days Date d=new Date(l+10006060247); System.out.println(d);
output=Sat Dec 17 19:31:51 IST 2011
Please can any one tell why this is coming wrong? Thanks a lot.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
