public static Date creditCardExpiryDate ( ) { DateTime dateTime = new DateTime ( ) ; DateTime addedMonths = dateTime . plusMonths ( JDefaultNumber . randomIntBetweenTwoNumbers ( 24 , 48 ) ) ; return addedMonths . dayOfMonth ( ) . withMaximumValue ( ) . toDate ( ) ; }
Typically Cards are good for 3 years . Will create a random date between 24 and 48 months