sql - Oracle - Convert a String (containing a date) into a String (another date's format) -


i have oracle database contains table have column (string) contains dates (in java code, tostring() of date inserted string column) , format example : fri feb 28 00:00:00 cet 2014

so need fix have standard format => instead of "fri feb 28 00:00:00 cet 2014" i'll have "2014-02-28 00:00:00.0"

for future insertions in database, problem fixed => usage of dataformat instead of tostring() on date.

but ! problem how convert entries in database !

i'd add not possible change type of column date must remain string.

any ideas ??

you need first convert timezone , reconvert string of required format. here query.

select to_char(to_timestamp_tz('fri feb 28 00:00:00 cet 2014', 'dy mon dd hh24:mi:ss tzd yyyy'), 'yyyy-mm-dd hh24:mi:ss') || '.0' dual;  to_char(to_timestamp_ --------------------- 2014-02-28 00:00:00.0 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -