rss· 投稿· 设为首页· 加入收藏· 繁體版
当前位置: 火魔网 » 数据库 » Informix

Orcle & informix 的日期格式转换在程式中的判断

if(TextParser.isNotEmpty(begintime))             if("oracle".equals(databaseType))                 SSQLClause = SSQLClause + " and logintime >=to_date('" + begintime.trim() + "','yyyy-mm-dd hh24:mi:ss')";
                logger.debug(SSQLClause);
            } else
            if("informix".equals(databaseType))                 SSQLClause = SSQLClause + " and logintime >=to_date('" + begintime.trim() + "','%Y-%m-%d %H:%M:%S')";
                logger.debug(SSQLClause);         }
        if(TextParser.isNotEmpty(endtime))             if("oracle".equals(databaseType))                 SSQLClause = SSQLClause + " and logintime<=to_date('" + endtime.trim() + "','yyyy-mm-dd hh24:mi:ss')";
                logger.debug(SSQLClause);
            } else
            if("informix".equals(databaseType))                 SSQLClause = SSQLClause + " and logintime<=to_date('" + endtime.trim() + "','%Y-%m-%d %H:%M:%S')";
                logger.debug(SSQLClause);         }
顶一下
(0)
踩一下
(0)