根据对于日期的不同格式的要求,把从数据库中取出的日期型变量进行处理,输出的时候,输出的变量就已经是个是画成要求的形式了。
一共三种形式:
switch (dbVendor) {
case 1:
returnDate = "to_date('" +
bvDate.format("strftime:%m/%d/%Y" +
(ignoreTime ? "" : " %H:%M:%S"))
+ "', 'mm/dd/yyyy" + (ignoreTime ? "" : " hh24:mi:ss") +
"')";
break;
case 2:
returnDate = "'" +
bvDate.format("strftime:%Y-%m-%d" +
(ignoreTime ? "" : " %H:%M:%S"))
+ (ignoreTime ? " 00:00:00" : "") + "'";
break;
case 3:
returnDate = "convert(datetime,'" +
bvDate.format("strftime:%Y/%m/%d" +
(ignoreTime ? "" : " %H:%M:%S"))
+ (ignoreTime ? " 00:00:00" : "") + "')";
break;
}