• Convert java.lang.String to oracle.jbo.domain.Date


    https://www.techartifact.com/blogs/2013/09/converting-java-lang-string-to-oracle-jbo-domain-date.html

    tions-

    /**
    *Converts a String to oracle.jbo.domain.Date
    * @param String
    * @return oracle.jbo.domain.Date
    */
    public oracle.jbo.domain.Date castToJBODate(String aDate){
              DateFormat formatter;
              java.util.Date date;
     
              if(aDate!=null){
     
                try {
     
                  formatter = new SimpleDateFormat("dd/MMM/yyyy");
                  date = formatter.parse(aDate);
                  java.sql.Date sqlDate = new java.sql.Date(date.getTime());
                  oracle.jbo.domain.Date jboDate = new oracle.jbo.domain.Date(sqlDate);
     
                    return jboDate;
                   } catch (ParseException e) {
     
                            e.printStackTrace();
                    }
     
             }
     
             return null;
    }

    Another scenario –Convert oracle.jbo.domain.Date to String

    Use this code-

    public String convertJbodateToString(oracle.jbo.domain.Date domainDate){
            
           SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S"); 
           Date date = null;
            
           try {
               date = formatter.parse(domainDate.toString().substring(0, 21));
           } catch (ParseException e) {
           }
            
                    
           SimpleDateFormat FORMATTER = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
           System.out.println("NewDate-->" + FORMATTER.format(date));
            
           return FORMATTER.format(date);
       }
  • 相关阅读:
    在python中使用正则表达式(二)
    在python中使用正则表达式(一)
    利用cookies进行登录并封装请求方法
    fiddler学习笔记&&基本使用
    理解css相邻兄弟选择器
    selenium+Page Objects(第三话)
    selenium+Page Objects(第二话)
    selenium+Page Objects(第一话)
    python+selenium基础之XPATH轴定位(第二篇)
    关于类、方法、对象(实例):静态方法
  • 原文地址:https://www.cnblogs.com/huanghongbo/p/8250957.html
Copyright © 2020-2023  润新知