Top "Calendar" questions

A calendar is a system of reckoning time in which the beginning, length and divisions of a year are defined.

Getting last day of the month in a given string date

My input string date is as below: String date = "1/13/2012"; I am getting the month as below: SimpleDateFormat dateFormat = new SimpleDateFormat("…

java date calendar
Java Date vs Calendar

Could someone please advise the current "best practice" around Date and Calendar types. When writing new code, is it best …

java date calendar
Leap year calculation

In order to find leap years, why must the year be indivisible by 100 and divisible by 400? I understand why it …

algorithm calendar leap-year
Why is January month 0 in Java Calendar?

In java.util.Calendar, January is defined as month 0, not month 1. Is there any specific reason to that ? I have …

java calendar
How to change TIMEZONE for a java.util.Calendar/Date

I would like to change the TIMEZONE value in a Java Calendar instance at runtime. I tried below. But the …

java datetime calendar
How do I create a link to add an entry to a calendar?

I'm working for this nightclub and are currently making a website for them, they've got lots events and their site …

html calendar google-calendar-api icalendar
Set Date in a single line

According to the Java API, the constructor Date(year, month, day) is deprecated. I know that I can replace it …

java date calendar
Why Java Calendar set(int year, int month, int date) not returning correct date?

According to doc, calendar set() is: http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html#set%28int,%20int,%20…

java calendar
System.currentTimeMillis() vs. new Date() vs. Calendar.getInstance().getTime()

In Java, what are the performance and resource implications of using System.currentTimeMillis() vs. new Date() vs. Calendar.getInstance().getTime() …

java performance date time calendar
Creating java date object from year,month,day

int day = Integer.parseInt(request.getParameter("day")); // 25 int month = Integer.parseInt(request.getParameter("month")); // 12 int year = Integer.parseInt(request.getParameter("…

java date time calendar