Android examples for java.util:Month
first Date Of Next Month
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static Date firstDateOfNextMonth(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date);/*from w w w. j ava 2 s.c o m*/ calendar.add(Calendar.MONTH, 1); Date newDate = calendar.getTime(); return firstDateOfMonth(newDate); } public static Date firstDateOfMonth(Date date) { try { return (new SimpleDateFormat("yyyyMMdd")) .parse((new SimpleDateFormat("yyyyMM")).format(date) + "01"); } catch (ParseException e) { return null; } } }