1. Error Reason:The date type cannot contain the precision after the second.As Date: 2010-01-01 20:02:20.0
Workaround: Remove the precision after the date secondsAs a date: 2010-01-01 20:02:20
2, INSERT into TEST2 (C1, C2,C3) VALUES
1. Cause of Error:The date type cannot contain precision after seconds.As Date: 2010-01-01 20:02:20.0Workaround: Remove the precision after the date seconds, To_date (substr (invoice_date,1,10), ' Yyyy-mm-dd ')If Date: 2010-01-01 20:02:202. INSERT
Oracle and Java date formats
If you want to convert to a 2005-07-05 format, you need to use the class SimpleDateFormat
SimpleDateFormat formatt= New SimpleDateFormat ("Yyyy-mm-dd");Date Date =new date ();System.out.println (Formatt.format
Date functionDate functions manipulate Date values (fields of date type), timestamp values (TIMESTAMP, TIMESTAMP with time ZONE, and TIMESTAMP with the fields of the local time ZONE type), and interval values (INTERVAL day to SECOND and INTERVAL
The time and date conversion of this style, similar to the microblogging release time, has been sorted and summarized as follows, and has solved so many key questions:
(1) Localize the time date string returned by the server (the server may not
Processing date in Oracle
To_date formatDay:Dd number 12Dy abbreviated FriDay spelled out FridayDdspth spelled out, ordinal twelfthMonth:MM number 03Mon abbreviated MARMonth spelled out MarchYear:YY two digits 98Yyyy four digits 1998
The time range
Oracle date functions are already available on the Internet. Let's focus on it to avoid your troubles.
Oracle date functions are already available on the Internet. Let's focus on it to avoid your troubles.
In the development of oracle databases,
In the development of Oracle databases, it is often a matter of time, so the date function of Oracle data is collected specifically. is for future investigation.
Add_months (d,n) Date d plus n months
Last_day (d) The date of the last day of the
To_date ("String to convert", "converted format") The format of the two parameters must match, otherwise it will be an error. That is, the first argument is interpreted in the format of the second parameter.To_char (date, "convert format") converts
This article focuses on the detailed usage examples of to_date in Oracle, including the use of period and character conversion functions, string and time conversions, the day of the week, the number of days between two dates, and the use of
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.