By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,501 Members | 1,859 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,501 IT Pros & Developers. It's quick & easy.

Problem with date

P: n/a
when i put record into table in this format
insert into test(boat_id,strartDate) values(2,to_date('2004-01-02
16:00:00','YYYY-MM-DD HH24:MI:SS'));

it is lood ok
but when i try to fet the record out
i see only the date and not the hour

how can i see the hour???/////

thanks Ofer
Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
of******@hotmail.com wrote in message news:<56*************************@posting.google.c om>...
when i put record into table in this format
insert into test(boat_id,strartDate) values(2,to_date('2004-01-02
16:00:00','YYYY-MM-DD HH24:MI:SS'));

it is lood ok
but when i try to fet the record out
i see only the date and not the hour

how can i see the hour???/////

thanks Ofer


either by using the to_char function in your select statement
(recommended) or by issuing alter session set nls_date_format =
'YYYY-MM-DD HH24:MI:SS' (not recommended, as now every other system
running your code should run the same alter session command)

Hth

Sybrand Bakker
Senior Oracle DBA
Jul 19 '05 #2

P: n/a
of******@hotmail.com wrote in message news:<56*************************@posting.google.c om>...
when i put record into table in this format
insert into test(boat_id,strartDate) values(2,to_date('2004-01-02
16:00:00','YYYY-MM-DD HH24:MI:SS'));

it is lood ok
but when i try to fet the record out
i see only the date and not the hour

how can i see the hour???/////

thanks Ofer


Sigh. Not enough information to answer your question.
What does your select look like?
What format do you get for the results of this query?
SELECT SYSDATE FROM DUAL;
Is the hour displayed?

Sorry we cannot be more helpful, but crystal balls are in short
supply, so they are restricted to the military. not that they ever
actually USE them 8^)

Ed
Jul 19 '05 #3

P: n/a
of******@hotmail.com wrote:

when i put record into table in this format
insert into test(boat_id,strartDate) values(2,to_date('2004-01-02
16:00:00','YYYY-MM-DD HH24:MI:SS'));

it is lood ok
but when i try to fet the record out
i see only the date and not the hour

how can i see the hour???/////

thanks Ofer


Why not use a mask, just like you used to put the value in?

If you read the manuals, you will find this is the default behaviour for
date columns.
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.