*
* @throws Exception
*/
public double toDouble (Date date, boolean includeDate, boolean includeTime) throws Exception
{
XFunctionAccess fa = getFunctionAccess();
Calendar c = Calendar.getInstance ();
c.setTime (date);
double val = 0.0;
if (includeDate) {
Object [] args = {new Integer(c.get (Calendar.YEAR)), new Integer(c.get (Calendar.MONTH) + 1), new Integer(c.get (Calendar.DAY_OF_MONTH))};
myLog.debug("Date = {}-{}-{}", args);
Double v = (Double)(fa.callFunction ("DATE", args));
val = v.doubleValue ();
}
if (includeTime) {
Object [] args = {new Integer(c.get (Calendar.HOUR)), new Integer(c.get (Calendar.MINUTE)), new Integer(c.get (Calendar.SECOND))};
myLog.debug("Time = {}-{}-{}", args);
Double v = (Double)(fa.callFunction ("TIME", args));
val += v.doubleValue ();
}
myLog.debug("return {}", val);
return val;
}