Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Locale; import android.os.Bundle; public class Main { public static Bundle bundleCalendar(Calendar cal) { Bundle args = new Bundle(); if (cal == null) cal = Calendar.getInstance(Locale.getDefault()); ; args.putInt("year", cal.get(Calendar.YEAR)); args.putInt("month", cal.get(Calendar.MONTH)); args.putInt("day", cal.get(Calendar.DAY_OF_MONTH)); args.putInt("hour", cal.get(Calendar.HOUR_OF_DAY)); args.putInt("minute", cal.get(Calendar.MINUTE)); return args; } public static Bundle bundleCalendar(Calendar cal, long minDate) { Bundle args = new Bundle(); if (cal == null) cal = Calendar.getInstance(Locale.getDefault()); ; args.putInt("year", cal.get(Calendar.YEAR)); args.putInt("month", cal.get(Calendar.MONTH)); args.putInt("day", cal.get(Calendar.DAY_OF_MONTH)); args.putInt("hour", cal.get(Calendar.HOUR_OF_DAY)); args.putInt("minute", cal.get(Calendar.MINUTE)); args.putLong("minDate", minDate); return args; } }