Home page

Monday, June 11, 2018

Generate Random Number

public static String generateRandomNumber() {
Calendar c = Calendar.getInstance();
String str = String.valueOf(c.get(Calendar.YEAR)) + String.valueOf(c.get(Calendar.MONTH)) + String.valueOf(c.get(Calendar.DAY_OF_MONTH)) + String.valueOf(c.get(Calendar.HOUR_OF_DAY)) + String.valueOf(c.get(Calendar.MINUTE)) + String.valueOf(c.get(Calendar.SECOND));
return str;
}

No comments:

Post a Comment