sql - (Oracle) convert date string to datetime -
how convert date string following format datetime
when running select statement?
2015-06-04t02:58:00.134+08:00
it stored in column data type varchar2
(100 byte).
thanks!
it stored in column data type varchar2(100 byte).
first of all, should never ever store date/timstamp string. database design flaw.
anyway, convert timestamp timezone.
for example,
sql> select to_timestamp_tz('2015-06-04t02:58:00.134+08:00', 2 'yyyy-mm-dd"t"hh24:mi:ss.ff tzh:tzm') 3 @ time zone '+8:00' tm_stamp 4 dual; tm_stamp ----------------------------------------------------------------- 04-jun-15 02.58.00.134000000 +08:00 sql>
Comments
Post a Comment