Date
-
java.util.Date minDate = new java.util.GregorianCalendar(2010,java.util.GregorianCalendar.MARCH,01).getTime(); // 1st mar 2010
-
java.util.Date maxDate = new java.util.GregorianCalendar(2020,java.util.GregorianCalendar.MARCH,01).getTime(); // 1st mar 2020
-
-
-
defDate = cal.getTime();
-
-
ti.setMinValue(minDate);
-
ti.setMaxValue(maxDate);
-
ti.setValue(defDate);
Use c.add(Calendar.DATE, 1); to add days
Add Year
-
Date newDate = new java.util.GregorianCalendar(Integer.parseInt(sYear),Integer.parseInt(sMon)-1,Integer.parseInt(sDay),11,22).getTime();
Convert Date to Text
Pause Delay Wait
To and From sqlite
-
//YYYY-MM-DD HH:MM:SS.SSS
-
if (p_in==null) return "'NULL'";
-
return "DATETIME('" + formatter.format(p_in) + "')";
-
}
-
//p_in format = 2012-09-30 16:33:41
-
if ("NULL".equals(p_in)) return null;
-
}
To and From xml
(Using javax.xml.bind.DatatypeConverter)
-
if ("NULL".equals(p_in)) return null;
-
return cal.getTime();
-
//SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
-
//return (Date) formatter.parse(p_in);
-
}
-
//XML Date format = 2008-10-31T15:07:38.6875000-05:00
-
if (p_in==null) return "'NULL'";
-
cal.setTime(p_in);
-
return DatatypeConverter.printDateTime(cal);
-
//SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
-
//return formatter.format(p_in);
-
}
Cheat Sheet http://www.ecotronics.ch/webdesign/javadate.htm
Formatting
Timeing
-
protected long m_intivalIncrement = TimeUnit.NANOSECONDS.convert(10, TimeUnit.SECONDS);
RJM Article Type
Work Notes