Java SQL Date Get getDateFromRTGSDateString(String iobDate)

Here you can find the source of getDateFromRTGSDateString(String iobDate)

Description

get Date From RTGS Date String

License

Open Source License

Declaration

public static Date getDateFromRTGSDateString(String iobDate) 

Method Source Code

//package com.java2s;
/*/*from ww w  .  j a v  a2s  .c o m*/
 * @(#)ConversionUtil.java
 *
 * Copyright by ObjectFrontier, Inc.,
 * 12225 Broadleaf Lane, Alpharetta, GA 30005, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of ObjectFrontier, Inc. You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of
 * the license agreement you entered into with ObjectFrontier.
 */

import java.sql.Date;

public class Main {
    public static Date getDateFromRTGSDateString(String iobDate) {

        Date date = null;
        try {
            int year = Integer.parseInt(iobDate.substring(0, 4));
            int month = Integer.parseInt(iobDate.substring(4, 6));
            int day = Integer.parseInt(iobDate.substring(6, 8));
            date = new Date(year - 1900, month - 1, day);

        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return date;
    }
}

Related

  1. getDateEnd(Date date)
  2. getDateForStr(String str)
  3. getDateFromISODateString(String isoDate)
  4. getDateFromLong(ResultSet resultSet, int index)
  5. getDateFromResultSet(ResultSet rset, Enum field)
  6. getDateFromTimestamp(Timestamp timestamp)
  7. getDateFromYMD(Date ymd)
  8. getDateInput(String prompt)
  9. getDateISO(final String sDate)