0
votes

table x

Hire_date

17-jun-87

how to convert it to '17-jun-1987 21:55:45' ?

I tried couple ways using to_char function or to_date function but getting some error

select to_char(hire_Date, 'dd-mmm-yyyy hh24:mi:ss') but was not successful ?

any suggestions please?

2
Where the time part comes from?Jens
usually in that way, if there is not time mentioned defaultly it takes as 00:00:00benny
Have you tried select to_char(hire_Date, 'dd-MON-yyyy hh24:mi:ss')?Jens
i have added the comment as answer. feel free to upvote/aceept it if it has helped.Jens

2 Answers

1
votes

Use:

select to_char(hire_Date, 'dd-MON-yyyy hh24:mi:ss')
0
votes

The problem is that you have mmm instead of mon

select to_char(hire_Date, 'dd-mmm-yyyy hh24:mi:ss')

change it to

select to_char(hire_Date, 'dd-mon-yyyy hh24:mi:ss')

should work