title: how to convert unix timestamp to oracle DATE
body: <p>I have a date type in oracle and i want insert unix timestamp  data into it.</p>
  
  <p>I use this SQL query in PL/SQL which works.</p>
  
  <pre><code>select TO_DATE('19700101','yyyymmdd') + 1413360712/86400 +TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone),1,3))/24 from dual;
  </code></pre>
  
  <p>the output is right.</p>
  
  <p><code>2014/10/15 16:11:52</code></p>
  
  <p>But when i use it in java, the output is different.</p>
  
  <pre><code>            String sql = "insert into appliance_application (id, emp_id, typeid, num, spec, action, actiontime, oper_id) VALUES(applianceapplication_seq.nextval, ?, ?, ?, ?, ?, TO_DATE('19700101','yyyymmdd') + 1413360712/86400 +TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone),1,3))/24, ?)";
              pstmt = conn.prepareStatement(sql);
  
              for(int i=0; i &lt; list.size(); i++){
                  Itembean ib = (Itembean)list.get(i);
                  pstmt.setObject(1, ib.getEmpid());
  ...   
  
  
  
                  pstmt.setObject(5, ib.getAction());
  //              pstmt.setLong(6, ib.getActiontime());
  //              pstmt.setObject(7, ib.getOper_id());
                  pstmt.setObject(6, ib.getOper_id());
                  log.info(ib.getActiontime()+ "....");
  
                  pstmt.addBatch();
              }
  
  ...
  </code></pre>
  
  <p>I check the inserted data and find output is wrong.</p>
  
  <p><code>2014/10/15 8:11:52</code></p>
  
  <p>my sessiontimezone is +8.
  what's wrong?</p>