Code example for Date

Methods: getTime, setMinutes, setTime

0
	} 
 
	public static String getCurrentDate() {
		Format dateFormatter = Preferences.getDateFormat();
 
		Date date = new Date();
		date.setTime(date.getTime() + 0 * 24L * 3600 * 1000);
		date.setMinutes(0);
 
		return dateFormatter.format(date);
	} 
 
	public static String capitalizeString(String string) {
		char[] chars = string.toLowerCase().toCharArray();
		boolean found = false;
		for (int i = 0; i < chars.length; i++) {
			if (!found && Character.isLetter(chars[i])) {
				chars[i] = Character.toUpperCase(chars[i]);
				found = true;
			} else if (Character.isWhitespace(chars[i]) || chars[i] == '.'
					|| chars[i] == '\'') { // You can add other chars here