Sysdate without time data

Posted on 2007-08-04
Last Modified: 2013-11-05
I need to pull sysdate as just a date (no time info)

What's the syntax?

Question by:Weller0123
    LVL 7

    Expert Comment

    select sysdate from dual;

    the above will not show u time.

    LVL 7

    Expert Comment

    select to_char(sysdate,'dd-mon-yyyy') from dual;
    LVL 12

    Accepted Solution

    LVL 28

    Expert Comment

    select to_char(sysdate,'dd-mon-yyyy') from dual;

    I think this is the best answer because this does not depend on the nls_date_format
    setttings otherwise it depends on the format which has been set to nls_date_format.

    select sysdate, trunc(sysdate), round(sysdate)
    from dual;
    -- will return date value according to the format set in nls_date_format. If you are
    going to use this, then make sure that you have set your nls_date_format accordingly
    which execludes time.

    LVL 12

    Expert Comment

    i agree with nav_kum_v, but it depends on what type you're expecting.
    if you want DATE, you can use either

    TO_DATE(TO_CHAR(SYSDATE, 'dd-mon-yyyy'), 'dd-mon-yyyy')

    TO_CHAR(SYSDATE, 'dd-mon-yyyy') will return a VARCHAR2 string ...

    LVL 31

    Expert Comment

    You say you want to "pull" sysdate as <just a date (no time info)>
    What are you going to do with it? If you just want to display it without any time shown, the default setting will likely manage that and, if not, the TO_CHAR(SYSDATE, 'dd-mon-yyyy') [or any other format mask without a time element] will accomplish that regardless of the default. If you are using it to compare with some other date datatype, the use of trunc(sysdate) will still have a time element (of midnight) so you may have to also use the trunc function on the "other date" to compare equality. Greater than and less than comparisons will also require some manipulation. Let us know of your intent.

    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Article by: Swadhin
    From the Oracle SQL Reference ( we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
    Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
    Via a live example, show how to take different types of Oracle backups using RMAN.
    This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now