In Oracle, you can use the "to_char" function to convert date format. This function is used to convert numeric or date type into character type. The syntax is "to_char(date,"conversion format")".
The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.
The function of Oracle to_char function is to convert numeric or date type into character type. The following is a detailed introduction to the use of Oracle to_char function. I hope it can be helpful to you. Helps.
Postgres formatting functions provide an efficient set of tools for converting various data types (date/time, int, float, numeric) into formatted strings and vice versa. Convert to original data type.
Note: The second parameter of all formatting functions is the template used for conversion.
: Get the current date is the number of the month
select to_char(sysdate,'YYYYMMDD W HH24:MI:SS') from dual; TO_CHAR(SYSDATE,'YY') select to_char(sysdate,'W') from dual;
2: Get the current date is the day of the week, note that Sunday is The first day
select sysdate,to_char(sysdate,'D') from dual;
Recommended tutorial: "Oracle Video Tutorial"
The above is the detailed content of How to convert date format in oracle. For more information, please follow other related articles on the PHP Chinese website!