Oracle Tutorial

  • Home
  • Start Here
  • Basics
  • Advanced
    • Oracle View
    • Oracle Index
    • Oracle Synonym
    • Oracle Sequence
    • Oracle Administration
  • PL/SQL
  • Functions
    • Aggregate Functions
    • Analytic Functions
    • Comparison Functions
    • Date Functions
    • String Functions
  • API
    • Python Oracle
Home / Oracle Date Functions / Oracle SYSDATE

Oracle SYSDATE

The Oracle SYSDATE function returns the current date and time of the Operating System (OS) where the Oracle Database installed.

Syntax

Since the SYSDATE function does not require any argument, you can call it without specifying the parentheses:

SYSDATE</code>
Code language: HTML, XML (xml)

Return value

The SYSDATE function returns the current date and time value whose type is DATE.

The format of the returned date time value depends on the value of the NLS_DATE_FORMAT parameter.

Examples

The following example returns the current date and time of the OS where the Oracle Database resides:

SELECT TO_CHAR(SYSDATE, 'MM-DD-YYYY HH24:MI:SS') FROM dual;
Code language: SQL (Structured Query Language) (sql)

In this example, we used the TO_CHAR() function to format the current system date and time value returned by the SYSDATE function.

The following table illustrates the arithmetic of the SYSDATE function:

SYSDATE MathDescription
WHERE (date) > SYSDATE - 8/24;Past 8 hours
WHERE (date) > SYSDATE - 30;Past 30 days
WHERE (date) > SYSDATE -
30/1440;
Past 30 minutes
8/248 hours
15/24/60/6015  seconds
1/24/60One minute
1/24One hour
TRUNC(SYSDATE+1/24,'HH')1 hour starting with the next
hour

Remarks

The Oracle SYSDATE function cannot be used in the condition of a CHECK constraint.

In this tutorial, you have learned how to use the Oracle SYSDATE function to get the current system date and time.

  • Was this tutorial helpful?
  • YesNo
Previous Oracle SESSIONTIMEZONE
Next Oracle SYSTIMESTAMP

Oracle Functions

  • Aggregate Functions
  • Analytic Functions
  • Comparison Functions
  • Date Functions
  • String Functions

Oracle Date Functions

  • ADD_MONTHS
  • CURRENT_DATE
  • CURRENT_TIMESTAMP
  • DBTIMEZONE
  • EXTRACT
  • FROM_TZ
  • LAST_DAY
  • LOCALTIMESTAMP
  • MONTHS_BETWEEN
  • NEXT_DAY
  • NEW_TIME
  • ROUND
  • SESSIONTIMEZONE
  • SYSDATE
  • SYSTIMESTAMP
  • TO_CHAR
  • TO_DATE
  • TRUNC
  • TZ_OFFSET

About Oracle Tutorial

OracleTututorial.com website provides Developers and Database Administrators with the updated Oracle tutorials, scripts, and tips.

Search

Recent Tutorials

  • Oracle Implicit Statement Results
  • Calling PL/SQL Stored Functions in Python
  • Calling PL/SQL Procedures in Python
  • Managing Transaction in Python
  • Deleting Data From Oracle Database in Python

Site Links

  • Oracle Books
  • About
  • Contact
  • Privacy Policy
  • Terms of Use

Copyright © 2021 Oracle Tutorial. All Rights Reserved.