Get system date fro...
 

Get system date from Oracle database using query  


Gnana
Posts: 25
(@gnana)
Eminent Member
Joined: 3 months ago

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 compareit with UNIX system date.

1 Reply
admin
Posts: 93
Admin
(@mjv119gmail-com)
Member
Joined: 5 years ago

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

Leave a reply


 
Preview 0 Revisions Saved
Share: