

Select to_char(to_date('1','dd-mon-yyyy'),'Day')from dual Users need to see what was the day on at that time we can use the following statement as follows. The end output of the above query we illustrate by using the following snapshot. In the above statement, we use alter session command to change the date format as per our requirement as shown in above statement. Suppose users need to display date and time in DD – MONTH – YYYY format at that time we can use the following statement as follows.Īlter session set NLS_DATE_FORMAT=’DD-MONTH-YYYY HH:MIpm’

Now we can check the date by using the following statement. In the above statement, we use the alter session command to change the date format as per our requirement as shown in the above statement. The formats of date is depending on NLS_DATE_FORMAT parameter and suppose we need to display date and time in date – month – yy format at that time we can use the following statement as follows.Īlter session set NLS_DATE_FORMAT='DD-MONTH-YY HH: MIpm'

In the above example, we use the select sysdate function to check system current date, here dual is a table name that is automatically created by oracle database with data directory and it is accessible to all users. At that time we use the following statement as follows. Suppose we need to see current system data. Now let’s see a different example of date format as follows.
