Java Day of getPaxBirthday()

Here you can find the source of getPaxBirthday()

Description

get Pax Birthday

License

Open Source License

Declaration

public static String getPaxBirthday() 

Method Source Code


//package com.java2s;
/*/* w  w w  . j  a va 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.Random;

public class Main {
    public static String getPaxBirthday() {
        int i = -(3 + getRandomNumber(70));
        Date date = new Date();
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.YEAR, i);
        cal.add(Calendar.HOUR, getRandomNumber(50));
        cal.add(Calendar.MONTH, getRandomNumber(9));
        date = cal.getTime();
        SimpleDateFormat df = new SimpleDateFormat("yyMMdd");
        return df.format(date);
    }

    public static int getRandomNumber(int bound) {
        Random random = new Random();
        return random.nextInt(bound);
    }
}

Related

  1. getIntevalDays(String startDate, String endDate)
  2. getLateInTheDay(Date date)
  3. getLatest7Day()
  4. getNDayAfterCurrentDate(String dateStr, String dateFormat, int n)
  5. getOtherDayLastUpdateTimeFormat()
  6. getPriorDay(int offset, String pattern)
  7. getRunningTime(Date date, SimpleDateFormat sday, String line)
  8. getSetDate(Date dt, int dayNum)
  9. getSignContinusDay(Date lastSignTime)