My Visit table is the following:
insert into Visit
values(12, to_date(\'19-JUN-13\', \'dd-mon-yy\'), to_date(\'19-JUN-13 12:00 A.M.\' , \'dd-mon-yy hh:mi A.M
You're relying on implicit date conversion, which is using your (session-dependent, but maybe inherited from the DB default) NLS_DATE_FORMAT
setting - in this case that seems to be DD-MON-RR
.
You can use to_char
to specify the format, e.g.:
select to_char(actualarrivaltime, 'DD-MON-YYYY HH:M:SS PM') from ..
The datetime format models are described in the documentation.
In general it's better to never rely on implcit conversions. Even if you get what you expect now, they can be session-specific so another user in another client ,ight see something different. This can cause failures as well as just look wrong. Always specify date and number formats, using to_date
, to_char
, to_timestamp
etc.