Date conversion in Oracle and Java

Source: Internet
Author: User

Date conversion in Oracle and Java date conversion in java date conversion to date summary in oracle: 1. Date attribute in Entity class is defined as String type. 2. Write the column corresponding to the date in the SQL statement as to_date (?, 'Yyyy-mm-dd hh24: mi: ss') 3. assign a value to the date attribute of the java entity class: SimpleDateFormat sdf = new SimpleDateFormat ("yyyy-MM-dd HH: mm: ss ");... www.2cto.com product. setPdate (sdf. format (new Date (); reads data of the date type from the oracle database and converts it to the data Type of java 1. the date attribute in the object class is defined as the String type. 2. the following is a description of the oracle Date Format parameter (which is not sensitive in lower case in oracle). d: day of the week: the name of the day, which is filled with spaces to 9 Characters dd: day of the month www.2cto.com ddd: day of the year dy: day abbreviated name iw: ISO standard year in the week iyyy: ISO standard four year yyyy: four-digit year yyy, yy, y: the last three digits of the year, two digits, one digit hh: hour, 12 hours hh24: hour, 24 hours mi: minute ss: second mm: month mon: month abbreviated month: full name of the month w: the nth week of the month ww: the nth week of the year

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.