How to get system date from Oracle database using query

Home Questions How to get system date from Oracle database using query

This topic contains 1 reply, has 1 voice, and was last updated by  admin 1 year, 10 months ago.

  • Author
    Posts
  • #6697 Reply

    Lina

    Using SQL query, how to fetch the system date from Oracle database?
    and is it possible to get the date in specific format like “YYMMDD” or “DDMMYY”?
    please explain in detail since I am very new to database queries.
    I am writing a shell script to check database connectivity and I need this information to fetch the database date and to compare it with UNIX system date.

  • #6789 Reply

    Scott Paul

    DDMMYY – select to_char(sysdate,’DDMMYY’) from dual;
    YYMMDD – select to_char(sysdate,’YYMMDD’) from dual;

    Like above example, change the string ‘DDMMYYYY’ as required.

    DD – Day
    MM – Month
    YY – Year

Reply To: How to get system date from Oracle database using query

You can use BBCodes to format your content.
Your account can't use Advanced BBCodes, they will be stripped before saving.

Your information: