Results 1 to 8 of 8

Thread: date format

  1. #1
    Join Date
    Feb 2004
    Posts
    6

    Unanswered: date format

    in which format is tha DATE written

  2. #2
    Join Date
    Feb 2004
    Location
    Atlanta, GA
    Posts
    21

    Re: date format

    dd-mon-yy

    for example,
    SQL> select sysdate from dual;

    SYSDATE
    ---------
    24-FEB-04
    It pays to share!

  3. #3
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    It is actually written with date and time ...

    24-FEB-04 08:50:00

  4. #4
    Join Date
    Feb 2004
    Posts
    6
    Originally posted by gbrabham
    It is actually written with date and time ...

    24-FEB-04 08:50:00
    Maybe, but it's possible to just write the date tough.

  5. #5
    Join Date
    Feb 2004
    Location
    Atlanta, GA
    Posts
    21
    You can format it anyway.
    It pays to share!

  6. #6
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    You may format it anyway you want, but I am assuming the question
    "in what format is the date written" to mean how are date columns stored in the database. I believe they are stored in date and time format according to the NLS_DATE_FORMAT init parm.

    Gregg
    ... I may be wrong, won't be the first, won't be the last ...

  7. #7
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Originally posted by gbrabham
    You may format it anyway you want, but I am assuming the question
    "in what format is the date written" to mean how are date columns stored in the database. I believe they are stored in date and time format according to the NLS_DATE_FORMAT init parm.

    Gregg
    ... I may be wrong, won't be the first, won't be the last ...
    Actually they are stored in a 7-byte value where each byte represents part of the date/time as follows:
    1 - century
    2 - year
    3 - month number
    4 - day of month
    5 - hour
    6 - minute
    7 - second

    The NLS_DATE_FORMAT is used as the default format mask in conversions between dates and character strings using TO_DATE and TO_CHAR.

    So whether you insert the value as TO_DATE('24-feb-04','dd-mon-rr') or TO_DATE('2004-02-24','YYYY-MM-DD'), what is stored in those 7 bytes is 20|04|02|24|0|0|0.

  8. #8
    Join Date
    Feb 2004
    Location
    Atlanta, GA
    Posts
    21
    Right, moderator.
    It pays to share!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •