Here you can find the source of getApisPaxBirthday(String dob)
public static String getApisPaxBirthday(String dob)
//package com.java2s; /*//w w w .jav a 2 s . c o m * All GTAS code is Copyright 2016, Unisys Corporation. * * Please see LICENSE.txt for details. */ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static String getApisPaxBirthday(String dob) { //06MAR72 //String day=dob.substring(0, 1); //int year = Integer.parseInt(dateString.substring(0, 4)); //int month = Integer.parseInt(dateString.substring(4, 6)); //int day = Integer.parseInt(dateString.substring(6)); int day = Integer.parseInt(dob.substring(0, 2)); String month = dob.substring(2, 5); int mon = 1; switch (month) { case "JAN": mon = 1; break; case "FEB": mon = 2; break; case "MAR": mon = 3; break; case "APR": mon = 4; break; case "MAY": mon = 5; break; case "JUN": mon = 6; break; case "JUL": mon = 7; break; case "AUG": mon = 8; break; case "SEP": mon = 9; break; case "OCT": mon = 10; break; case "NOV": mon = 11; break; case "DEC": mon = 12; break; } int year = Integer.parseInt(dob.substring(5)); Calendar cal = new GregorianCalendar(year, mon, day); Date date = cal.getTime(); SimpleDateFormat df = new SimpleDateFormat("yyMMdd"); //System.out.println("DOB<<<<<<<<<<----"+df.format(date)); return df.format(date); } }