• Skip to primary navigation
  • Skip to main content

Tech Honey

The #1 Website for Oracle PL/SQL, OA Framework and HTML

  • Home
  • HTML
    • Tags in HTML
    • HTML Attributes
  • OA Framework
    • Item in OAF
    • Regions in OAF
    • General OAF Topics
  • Oracle
    • statement
    • function
    • clause
    • plsql
    • sql
You are here: Home / Oracle / function / Oracle/SQL CURRENT_DATE Function

Oracle/SQL CURRENT_DATE Function

November 5, 2012 by techhoneyadmin

SQL Current_Date FunctionIn Oracle/SQL CURRENT DATE is returned by Oracle CURRENT_DATE Function. Also, SQL CURRENT_DATE Function returns time of current SQL session.Oracle CURRENT_DATE Function returns date/time set by SQL ALTER SESSION Statement. Oracle CURRENT DATE can also be used with SQL TRUNC Function to view only the date component.


SQL CURRENT DATE Function Syntax

SELECT CURRENT_DATE 
FROM table_name;

SQL CURRENT DATE Examples

Oracle CURRENT DATE – Using SELECT Statement Example

Oracle CURRENT_DATE Function is used with SQL SELECT Statement to fetch current date/time information.

For example, below SQL query returns current date/time.

SELECT CURRENT_DATE 
FROM DUAL;

Above SQL query may return something like “11/5/2012 11:52:27 AM”.


Oracle CURRENT DATE – SET TIME ZONE Example

The ALTER SESSION SET TIME ZONE Statement alters the time zone of the database.

For example, below SQL ALTER SESSION SET TIME ZONE Statement will alter the time zone of database.

ALTER SESSION SET TIME_ZONE = '-7:0';

The SQL query below will return different data now.

SELECT CURRENT_DATE 
FROM DUAL;

Above SQL CURRENT_DATE query may return something like “11/4/2012 11:24:22 PM” because time zone has been altered.


Oracle CURRENT DATE – Removing Time Component Example

SQL TRUNC Function can be used with the SQL CURRENT_DATE to remove the time component.

For example, the SQL query below will return current date and not time.

SELECT TRUNC(CURRENT_DATE)
FROM dual;

Above SQL query may return “11/4/2012”.


Filed Under: function Tagged With: CURRENTDATEPLSQL, current_date function in oracle plsql, current_date function in oracle sql, how to use current_date function in oracle database query, how to use current_date function in oracle plsql, how to use current_date function in oracle sql, syntax and example of current_date function in oracle database query, syntax and example of current_date function in oracle plsql, syntax and example of current_date function in oracle sql, using current_date function in oracle database query, using current_date function in oracle plsql, using current_date function in oracle sql

Copyright © 2023 · Parallax Pro on Genesis Framework · WordPress · Log in