|
From: Eric P. <th...@us...> - 2010-12-16 18:23:43
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28774 Modified Files: DateUtil.java Log Message: Always set the millis to zero in readDefaultUSAFullValue, otherwise comparisons can be thrown off. Index: DateUtil.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util/DateUtil.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** DateUtil.java 15 Dec 2010 00:55:22 -0000 1.23 --- DateUtil.java 16 Dec 2010 18:23:35 -0000 1.24 *************** *** 509,513 **** * Read the standard USA full date, regardless of what our current * locale and date preferences are. Returns null if the date cannot ! * be read. Example date: "Nov 25, 2008 10:15:53 AM" */ public static Date readDefaultUSAFullValue(String val) --- 509,514 ---- * Read the standard USA full date, regardless of what our current * locale and date preferences are. Returns null if the date cannot ! * be read. Example date: "Nov 25, 2008 10:15:53 AM". The millis ! * will always be set to zero. */ public static Date readDefaultUSAFullValue(String val) *************** *** 586,589 **** --- 587,591 ---- //System.out.println("hour: " + hour); Calendar cal=Calendar.getInstance(); + cal.set(Calendar.MILLISECOND,0); //zero any existing value cal.set(year,month,day,hour,minutes,seconds); return cal.getTime(); |