K2InformaticsGmbH / erloci

Erlang Oracle native driver - DEPRECATED, see https://github.com/K2InformaticsGmbH/oranif instead
Apache License 2.0
37 stars 11 forks source link

Hour,Minutes,Seconds increased by 1 #49

Open c-bik opened 7 years ago

c-bik commented 7 years ago

cc : @ElMaxo

> SelStmt = OciSession:prep_sql(
    "select to_char(sysdate, 'DD-MM-YYYY HH24:MI:SS'), sysdate from dual").
> SelStmt:exec_stmt().
{cols,[{<<"TO_CHAR(SYSDATE,'DD-MM-YYYYHH24:MI:SS')">>,
        'SQLT_CHR',38,0,0},
       {<<"SYSDATE">>,'SQLT_DAT',7,0,0}]}
> SelStmt:fetch_rows(100).
{{rows,[[<<"29-06-2017 10:58:18">>,
         <<120,117,6,29,11,59,19>>]]},
 true}
> oci_util:oradate_to_str(<<120,117,6,29,11,59,19>>).
"****.06.29 11:59:19"

Hours, minutes and seconds shifted by 1

ElMaxo commented 7 years ago

Here is an example of proper date decoding: https://github.com/erlangbureau/jamdb_oracle/blob/master/src/jamdb_oracle_tns_decoder.erl#L548