Problem with date

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ofer_c33@hotmail.com

    Problem with date

    when i put record into table in this format
    insert into test(boat_id,st rartDate) values(2,to_dat e('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
  • sybrandb@yahoo.com

    #2
    Re: Problem with date

    ofer_c33@hotmai l.com wrote in message news:<5604e7df. 0401020304.adf7 50f@posting.goo gle.com>...
    when i put record into table in this format
    insert into test(boat_id,st rartDate) values(2,to_dat e('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

    Comment

    • Ed prochak

      #3
      Re: Problem with date

      ofer_c33@hotmai l.com wrote in message news:<5604e7df. 0401020304.adf7 50f@posting.goo gle.com>...
      when i put record into table in this format
      insert into test(boat_id,st rartDate) values(2,to_dat e('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

      Comment

      • Hans Forbrich

        #4
        Re: Problem with date

        ofer_c33@hotmai l.com wrote:
        >
        when i put record into table in this format
        insert into test(boat_id,st rartDate) values(2,to_dat e('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.

        Comment

        Working...