Calendar 1 « Calendar « Java Data Type Q&A





1. Match Calendar objects in Java?    stackoverflow.com

I want to have objects that define partial dates / times similar to the entries in Unix crontabs, i. e. "every first day in any month" etc. These objects are going to ...

2. Is there a Java CalDAV api?    stackoverflow.com

I want to communication using CalDAV across to my calendar server, any Java API for this?

3. A good Business calendar library in Java?    stackoverflow.com

Does anyone knows a good business calendar library in java? It should handle easy :) date calculations, taking holidays into account. Ideally, besides configuring holidays and company off days, we should also ...

4. How get all calendar entries for a given using the Notes.Jar for Java    stackoverflow.com

I am working on a simple java code to extract all calendar entries for a given date. I know it possible using Domingo but I would like to use only Notes.jar ...

5. Help with Java Calendar -- it is giving some strange output    stackoverflow.com

I'm newish to Java and am trying to do somethings with dates. First I started using the Date class, which I found out was mostly deprecated so I switched over ...

6. Get Today's Calendar Entries in Lotus Note using Java    stackoverflow.com

I am trying to get the calendar entries for a given day. The code works without error however I am getting a wrong calendar date entry. I am sure the formula ...

7. Java calendar engine    stackoverflow.com

Does anybody know any engines for calendar implementation? For example, which accepts event definition object (it can be iCalendar-style) and current date as input and outputs whether this date matches event definition? ...

8. Regarding Java Calendar class    stackoverflow.com

I wanna programmatically convert an integer in the range 1-12 to corresponding month name. (e.g. 1 -> January, 2 -> February) etc using Java Calendar class in one statement. Note : ...

9. using java Calendar    stackoverflow.com

I have a simple task. There are two classes : Ticket and Date. Ticket contains event, event place and event date which is a Date object. I also need to provide ...





10. Are there any open source and free calendar UI reusable components?    stackoverflow.com

We need to implement scheduling subsystem. And we plan to integrate subsystem with our desktop and online applications. But we would like to reuse as many components as possible. One component ...

11. JCalendar customization    stackoverflow.com

Hello all I 'm trying to use JCalendar but i'm not sure it has all the abilities i need. 1.Is it possible to select multiple dates? 2.Is it possible to change the ...

12. Java calendar getting weekdays not working    stackoverflow.com

I am trying to get this to output all the weekdays (MON-FRI) between 5/16/2010 (a sunday) and 5/25/2010 (a tuesday). The correct output should be 17,18,19,20,21,24,25. However, the result im getting ...

13. Does Javascript have Java's Calendar helper class?    stackoverflow.com

i'm trying to use the Java version of:

Date d = new Date(2010, Calendar.AUGUST, 28);
but in Javascript:
var d = new Date(2010, ???, 28);
i cannot find a helper class that contains month constants? ...

14. Extending Calendar in Java    stackoverflow.com

I wanted to add more methods to the Calendar from java.util.Calendar, but I'm having trouble using the getInstance method. If I have an object like:
public class DateObject extends Calendar{ // other methods ...

15. How to get localized short day-in-week name (Mo/Tu/We/Th...)    stackoverflow.com

Can I get localized short day-in-week name (Mo/Tu/We/Th/Fr/Sa/Su for English) in Java?

16. How do you create a proper Epoch calendar object in Java?    stackoverflow.com

I want to create a calendar object that is the epoch date. What's the 'correct' (if any) way to do it?

Date epochDate = new java.text.SimpleDateFormat ("dd/MM/yyyy HH:mm:ss z").parse("01/01/1970 01:00:00 GMT");
Calendar ...





17. JAVA Calendar - How to check if it's Saturday/Sunday?    stackoverflow.com

What this code does is print the dates of the current week from Monday to Friday. It works fine, but I want to ask something else: If today is Saturday or ...

18. How to create own calendar reminder in java?    stackoverflow.com

We have a calendar in our web application. Events can be added to the calendar. Events will have some start date and end date. Events can also have a reminder. So, ...

19. Any Java date picker for the Jalali Calendar?    stackoverflow.com

Hi
I need a Jalali date picker to use in my Swing application.
Can you suggest me one? Thanks

20. Why can i have only one instance of Calendar object    stackoverflow.com

I was just wondering... why can i have only one instance of Calendar object. Is there a reason for it to be a singleton? I have tried to read the

21. Java missing 28 seconds    stackoverflow.com

I'm trying to extract a table from a database and reloading it in another type of database. The problem is that with my local settings the date 1 july 1937 poses ...

22. Need help printing numbers in a chart fashion in java for a calendar. Really easy    stackoverflow.com

Hey I have a calendar that I need to print out. It has two classes, one that was done for us, and the second that we had to do. The first ...

23. what does object Calendar do?    stackoverflow.com

I had a test for object Calendar:

for (int i = 0; i < 11; i++)
            System.out.println(calendar.get(i));


output:
1
2011
6
28
2
6
187
4
1
1
10
My question is how can ...

24. Java Localized Calendar    stackoverflow.com

I'm developing an internationalized application, in which I need to dynamically change my calendar without changing the code. As you know, Calendar.getInstance() returns a Gregorian calendar, how can I use a ...

25. Dynamic construction of anonymous class confusion    stackoverflow.com

I'm trying to make instances of anonymous classes using reflection. But ocassionally I've seen strange behaviour during instantination. Please, look at these similar fragments of code

public class HideAndSeek {

    ...

26. java ui component to represent calendar in tabular form    stackoverflow.com

I would like to show the calendar in the tabular form with weeks and days. Any suggestion on which component/library i can use? Thanks in advance, Shags

27. Calendar roll affects other calendar    stackoverflow.com

I have a piece of code I dont quite understand. Its causing a bug. There's a Calendar object and a method which writes this calendar object to a string, but increments the ...

28. how to pop up calendar when button is clicked in Java SWT?    stackoverflow.com

I am trying to develop Java SWT application in eclipse. I need to populate text box using DateTime Calendar in SWT when a button is clicked. I tried the following code but not ...

29. Java Calendar.getTimeInMillis    stackoverflow.com

I'm trying to convert String timestamps of the form "201110250830" (yyyyMMddhhmm) to a number of milliseconds (a long). I'm using the following code:

Calendar t = Calendar.getInstance();
      ...

30. Java why calendar afieldset is false?    stackoverflow.com

I use java calendar. When I change date using calendar.set(...) I see in debugger

areFieldSet=false. 
How can I make it to true? Because when I ask date - I receive not correct ...

31. Calendar program. Help with steps    bytes.com

Ok thanks alot for the first method, I will try it out when I get the chance. As for the import calendar class, I thought I was supposed to type that ...

32. How to build calendar using ical4j API itself?    bytes.com

Hi vidi, In your code you have build the calendar content using string buffer. I want to build calendar using ical4j API itself. For example Calendar calendar = new Calendar(); calendar.getProperties().add(new ...

34. How to get an Accurate Calendar Instance to milliseconds    coderanch.com

Perhaps you're using a sophisticated, multi-threaded OS. You get a small timeslice, and get 40 operations done in it, all in the same nano-second. Then the OS stops your threat, and calls another one, i.e. refreshing the clock, looking for new hardware connected, refreshing the screen. After this work is done, 20 nanos are gone, and you get another timeslice, to ...

35. Displaying Graphical calendar !!    coderanch.com

Hi, I'd like to know how to display a calendar. My requirement is like to show as many columns as my days are and if there is any my assignment starting on 2004-May-1, 09:30 and ends on 2004-May-3, 21:50 I should be able to see it graphically with exact time also(with some rectangle on the calendar). How should I write this ...

36. Calendar object    coderanch.com

Hi, To me this is a hard question. I hope I'm posting this in the right area if not I'm sorry. In the future, I want to be a java programmer so I'm creating an application. At this point, I'm inserting dates into a database as for example 02/19/2005 and displaying it as February 19, 2005 using dateformat. My problem, that ...

37. Calendar problem    coderanch.com

Hi I need to get the date of a Calendar object i tried to do the following code but got a differnet result import java.util.Calendar; pubic class TestCalendar { Calendar today; public TestCalendar() { today = Calendar.getInstance(); } public static void main(String args[]) { System.out.println("Todays date is:"+today.DAY_OF_MONTH+"/"+today.MONTH+ "/"+today.YEAR); } I was expecting like 24/3/2005; but I got 5/2/1 i do not ...

38. Calendar in Java 1.5 and 1.3    coderanch.com

Hi, I have the following code: import java.util.*; public class cal { public static void main(String[] args) { Calendar c = new GregorianCalendar(); Calendar c2 = Calendar.getInstance(); c2.set(Calendar.DAY_OF_MONTH,1); c.setFirstDayOfWeek(c2.get(Calendar.DAY_OF_WEEK)); c.set(Calendar.DAY_OF_WEEK, 1); c.set(Calendar.WEEK_OF_MONTH, 3); System.out.println(c.getTime()); } } when I ran it in java 1.5 I get the output: Sun Aug 21 20:40:19 EDT 2005 in java 1.3.1, this is printed out: Sun ...

39. Strange behavior of the Calendar get() method    coderanch.com

Strange behavior of the Calendar get() method I have follwing code involving use of get() method of the calendar object . The problem is that the date is getting offset by 14 days back (every time)when i try to use these method to set the date on a object and this happens for year earlier then 1970. The strange part is ...

40. Creation of a calendar    coderanch.com

41. Calendar functionality    coderanch.com

42. Calendar    coderanch.com

I have a "Date-book" type application and wanted to add a graphical calendar to it, much like the ones that are built in to the system trays in most OS, something where the current day is highlighted and the date of the current entry is highlighted. Is there a good package that would help me with this or would I have ...

43. Calendar deserialization question    coderanch.com

The toString method and the fact that a class implements Serializable have nothing really to do with each other. It is my understanding that if Calendar implements Serializable (I'll take your word for it, and I suspect that it would), then it is just a signal to the user of the class that if you save the object and restore the ...

44. Calendar and UTC    coderanch.com

I'm trying to get a time in UTC milliseconds using the following code: Calendar nowCal = GregorianCalendar.getInstance(TimeZone.getTimeZone("UTC")); System.out.println("UTC=" + nowCal.getTimeInMillis()); However, the milliseconds returned are for BST - that is they are adjusted for DST. Is this a bug in Calendar or am I missing something simple? I have tried various things like passing in the locale etc. Do I need ...

45. JDK1.3 calendar problem    coderanch.com

Hi all I was just wondering if anyone knew of a problem with Java version 1.3 calendar? The reason i ask is that I have a small class which calculates the number of working days (excluding bank holidays, as I can't work a way round them) between to dates. However I have noticed that for some dats it's calculating the days ...

46. Calendar class    coderanch.com

Calendar.DAY_OF_WEEK is not a method. It is a static field: package java.util; //. . . public abstract class Calendar implements Serializable, Cloneable, Comparable { //. . . /** * Field number for get and set indicating the day * of the week. This field takes values SUNDAY, * MONDAY, TUESDAY, WEDNESDAY, * THURSDAY, FRIDAY, and SATURDAY. * * @see #SUNDAY * ...

47. Calendars    coderanch.com

I've been looking at the GregorianCalendar class, and I'm finding that after spending some time getting familiar with the interface, it actually is a decent way of dealing with time. Now I have a special timekeeping application, and I'm wondering about possible extensions to the Calendar Class. For astronomical purposes, there are apparently calendars that differ slightly from common time. There ...

48. fields in Calendar after deserialization ??    coderanch.com

I'm getting something strange here. I serialized some GregorianCalendar classes, and when I bring them back into memory, the MONTH field ends up in some cases having a ridiculously high value > 12. If that wasn't weird enough, it happens when I use the get() method, but if I send the date to a DateFormat, the output seems correct. What's going ...

49. setTimeInMillis Calendar    coderanch.com

Also, unless a Sun employee gets away with not following the rules afaik they will put an @since tag on the method if it's newer than the class. So, if the class was introduced in 1.2 the class will be tagged @since 1.2 and if a specific method was introduced in 1.4 the method will be tagged @since 1.4.

50. urgent help..Using Calendar instance    coderanch.com

Originally posted by meera jan: Yes martin,I tried it.If SUNDAY is replaced by SATURDAY ,it will give all the Saturdays.But what i want is only the 1st saturdays,2nd saturdays...and so on.Is it possible with this. thanx Well, obviously you would have to write some more code if you wanted to include only the first Saturday of every month. But ...

51. Tough Calendar class questions    coderanch.com

Hello, I have two really tough Calendar class questions that resemble word problems (two variables known, third unknown). first You have month and year (integer format). How many days were in that month? Example: 10/2005,4/2004,6/2006 second You have week and year (integer format) What month does it refer to? Example: week5,week10,week32,week40 and 2006,2005,2002 I'm not familiar with Calendar classes but it ...

52. about calendar    coderanch.com

53. Calendar problem in japanese xp version.    coderanch.com

Hi, We are using a calendar component, which is developed in SWT. One of my user installed the application in japanese xp version. when he selected 28th of July it appears as 06/07/1928. Month and week names are also displayed in japanese. private DateFormatSymbols dateSymbols = new DateFormatSymbols(Locale.ENGLISH); dateSymbols.getMonths()[month]; But it works fine in windows 2000/xp . Please let me know ...

54. Calendar    coderanch.com

55. setFirstDayOfWeek in Calendar    coderanch.com

Calendar myCalendar = Calendar.getInstance(); myCalendar.setTime(new Date()); System.out.println("Day of week: " + myCalendar.get(Calendar.DAY_OF_WEEK)); System.out.println("First day of week: " + myCalendar.getFirstDayOfWeek()); myCalendar.setFirstDayOfWeek(Calendar.MONDAY); System.out.println("Day of week: " + myCalendar.get(Calendar.DAY_OF_WEEK)); System.out.println("First day of week: " + myCalendar.getFirstDayOfWeek()); C:\_tools\code>java CalendarCheck Day of week: 6 First day of week: 1 Day of week: 6 First day of week: 2

56. Calendar class    coderanch.com

This is one part of my coding to generate a Gantt Chart. the problem is how can i convert from my chart.java that i kept the month integer to be put into the calendar in this codes below. as you can see that i retrieve from chart class the start day and the year also. but the calendar, i am not ...

57. Question regarding Calendar in Java    coderanch.com

Hi, I have a question regarding the use of Calendar. User will give year (e.g 2006,2007, etc.) as input. I have to find out the "date" of the "first friday" of each month through out the year. Then I have to display thaose as result. How can I do that? Can anyone please help me for solving this problem? Can any ...

58. Question regarding the use of Calendar    coderanch.com

I have a question regarding the use of Calendar. User will give year (e.g 2006,2007, etc.) as input. I have to find out the "date" of the "friday,saturday and sunday" of each month through out the year. Then I have to display thaose as result. How can I do that? Can anyone please help me for solving this problem? Can any ...

59. Calendar problem    coderanch.com

Hi, This is what i did previously, /** * Method pulls back all fridays within the given date range */ public void getDaysInYear(Calendar startCal, Calendar endCal) { List fridays = new ArrayList(); while(startCal.compareTo(endCal) == -1) { if(startCal.get(Calendar.DAY_OF_WEEK) == Calendar.FRIDAY) { fridays.add(startCal.getTime().toString()); } startCal.add(Calendar.DAY_OF_WEEK, 1); } for (String friday : fridays) { System.out.println(friday); } } This just uses two passed in dates ...

60. Calendar Control    coderanch.com

Not really. I have written my own DateChooser which uses a JSpinner for the year and a JSpinner with a SpinnerListModel and a custom combo box spinner editor for the months (loaded from the default locale or a specified locale) but for the rest it's basically the same. I also written a DateSelecter class which does the same but can have ...

61. Calendar Printing problem    coderanch.com

i have a java program that makes a calendar to put daily reporting info. it usually puts the newer month calendar on the top but for the month of Nov the calendar printed at the bottom of the older months. does anyone know what might be wrong. Relevant code is below for(int yi = (yearsArr.length-1); yi >= 0; yi--) { try ...

62. java calendar object set as null    coderanch.com

63. Problems with Calendar.clear() method    coderanch.com

Here is an extract of my code. I convert a Calendar to a Date object and to a Calendar again. I then try and clear fields to just leave the year part. For the hour part I use set(Calendar.HOUR_OF_DAY, 0) as described by the JavaDoc. Calendar calendar1 = Calendar.getInstance(); calendar1.set(2009, Calendar.JANUARY, 29, 23, 59, 55); Date date1 = calendar1.getTime(); Calendar startDay ...

64. Calendar class question    coderanch.com

This isnt as much of a question as is to comprehend the thinking behind the Calendar class. Can any one please thrown some light on why adding months ( say 5 )to a date a date should be as convoluted as Calendar c = Calendar.getInstance(); c.add(Calendar.MONTH,5); instead of something like Calendar c = Calendar.getInstance(); c.addMonths(5); Why the extra step of specifying ...

65. Calendar problem !!    coderanch.com

HI ranchers, I am trying to set date as ' 30 April 2008' i.e 4/30/08 , but i am getting a date which is a month ahead ?? my code : import java.util.*; import java.text.DateFormat; class ABC { public static void main(String sd[]) { Calendar c = Calendar.getInstance(); c.set(Calendar.DATE, 30); c.set(Calendar.MONTH, 4); // Here is the problem. The month 4 is ...

66. Customizing java Calendar    coderanch.com

67. US Holidays Calendar    coderanch.com

I have a requirement, given a date, I want X number of WORKING days from that starting date. So I want to ignore weekends and US holidays. Do you have any ideas? I want to see if there's any existing class out there that has this functionality already before starting to write one. Thanks

68. Calendar    coderanch.com

Here's the only way I know to make the clock show up in the frame border... use a thread to update the label on the frame... hopefully this is what you wanted... import java.awt.*; import java.awt.event.*; import java.util.Date; import java.text.SimpleDateFormat; public class TimeFrame extends Frame implements Runnable { Thread timeThread; boolean threadOn; public TimeFrame() { super(); } public void start() { ...

69. Calendar Conversions    coderanch.com

Hi, I am trying to make a little program that will print out the times of cities around the world. To do this I am creating different Calendar objects. Here is what I have so far: //This will get the time in Raleigh, NC (Local Time) Calendar raleighTime = Calendar.getInstance(); Date d = raleighTime.getTime(); SimpleDateFormat formatter = new SimpleDateFormat ("hh:mm a ...

70. Calendar Class    coderanch.com

71. Calendar Program    coderanch.com

I am building a calendar program and I am having some trouble with the design of the repeating events. If I make an event happen on the first day of the month that aint so tuff, however if they want the event to show up on their calendar every 2 weeks... would you have to take the first day it was ...

72. more Calendar stuff    coderanch.com

Hi Andrew, Whenever you use DateFormat you must use it on both ends. What does that mean? Well you have used it to output your string into SHORT form, so you must also use it when you read in back in from SHORT form. The following example shows what I am talking about. public static void main( String[] args ) { ...

73. Calendar and java    coderanch.com

75. Calendar    coderanch.com

Is this a Daylight Saving Time effect ? You say that it goes wrong when you instantiate the calendar. Is Calendar converting the absolute time that is held in the Date object into the time in your current time zone, including your current Daylight savings settings? Are you using the locale version of the constructor ? Have you reverted to UCT ...

76. Simple Calendar    coderanch.com

77. Calendar class    coderanch.com

78. Basic Calendar    coderanch.com

Try this - it's a swing app, so I'm not sure if it's what you're after, but there might be something in it for you. import java.util.*; import java.text.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; class DatePicker extends JFrame implements ActionListener { private static JButton btns[] = new JButton[49]; private static JButton btnNext = new JButton("Forward 1 Month >>>"); private static ...

79. plz help with Calendar doubt.. ;-)    coderanch.com

Hi e'body.. my objective is to find the date of first SUNDAY in every month.. and I have written some code.. import java.util.*; import java.text.*; class Testing{ public static void main(String args[]) throws Exception{ Calendar rightNow = Calendar.getInstance(); SimpleDateFormat sdf=new SimpleDateFormat("MM/dd/yyyy"); rightNow.set(rightNow.WEEK_OF_MONTH, 1); rightNow.set(rightNow.DAY_OF_WEEK, rightNow.SUNDAY); String firstSunday=sdf.format(rightNow.getTime()); System.out.println(firstSunday); } } This is giving me first SUNDAY of first week.. not first ...

81. Calendar    coderanch.com

82. Calendar    coderanch.com

I have some code in which I want to create a current date for today. Then I want to subtract 3 months worth of time. So for the day Feb 11, 2003 I would want the date to be Nov 11, 2002. Here's my first attempt: Calendar now = new GregorianCalendar(); now.add(now.MONTH, -3); int begYear = now.get(Calendar.YEAR); System.out.println(begYear); int begMonth = ...

83. Calendar Class    coderanch.com

84. Calendar variables    coderanch.com

Hi all again! I began to make a program for a library that uses Date variables. I found out that the Date type is being deprecated as my compiler says. Si I'm updating it to Calendar. But I have a few questions: 1. Can I translate a String to a Calendar? 2. Can I know the difference (in days) between to ...

85. Calendar object January return 0?    coderanch.com

If you need to store a month value internally as 1..12, then you should first calculate the offset from the start of your range to that returned by Calendar. Then you can add that to any value calculated using Calendar.final int MONTH_RANGE_START = 0; final int MONTH_OFFSET = MONTH_RANGE_START - Calendar.JANUARY; ... elsewhere ... Calendar cal = ... int month = ...

86. Calendar    coderanch.com

87. Calendar woes    coderanch.com

88. Calendar class Regarding...    coderanch.com

89. Calendar math    coderanch.com

Hey, I was wondering if it's possible to subtract one date from another, to determine how many days have passed? For example: - Say I have an record of a user account created on February 22, 2006. - Today is March 14, 2006. How can I determine how many days old the account is?

90. Calendar weirdness...    coderanch.com

I'm trying to develop a simple method that prints the day, month, day number, and year from the current day forward for 4 months. For example, from today forward it would start like this: Thu, Mar 30, 2006 Fri, Mar 31, 2006 Sat, Apr 1, 2006 Sun, Apr 2, 2006 Mon, Apr 3, 2006 Tue, Apr 4, 2006 ... I've got ...

91. calendar    coderanch.com

92. Question about Calendar    coderanch.com

Thanks Guys, you're absolutley right. The months start at index 0 instead of 1, so this needs to be adjusted for. Apparently I had August as 8. Incidentally, why exactly is it it done this way? wouldn't it be a lot less confusing to just have the Months indexed from 1, like in the actual Gregorian calendar?!

93. Using Calendar class    coderanch.com

Hello everyone, Can any body elaborate, how to get maximum number of weeks in a month given Calendar instance? For example in December 2007, if the first day of week is set to Calendar.SATURDAY, then total weeks should be 6. And it should be 5 in case the first day of week is set to Calendar.MONDAY. The getMaximum(Calendar.WEEK_OF_MONTH) always returns 6; ...

94. calendar    coderanch.com

I am trying to print date :- Calendar cal = Calendar.getInstance(); cal.set(Calendar.DAY_OF_MONTH, -1); System.out.println(cal.getTime()); cal.set(Calendar.DAY_OF_MONTH, -1); System.out.println(cal.getTime()); cal.set(Calendar.DAY_OF_MONTH, -1); System.out.println(cal.getTime()); cal.set(Calendar.DAY_OF_MONTH, -1); System.out.println(cal.getTime()); it is giving output:- Tue Oct 30 02:17:20 PDT 2007 Sat Sep 29 02:17:20 PDT 2007 Thu Aug 30 02:17:20 PDT 2007 Mon Jul 30 02:17:20 PDT 2007 can any body please tell me what should be the ...

95. Doubt in Calendar.get(int field)    coderanch.com

That would depend on whether the number you passed was a valid value or not. If it wasn't a valid value an ArrayIndexOutOfBoundsException would be thrown. If it was a valid value then it would return the appropriate value for the number you passed. You can find out the actual value of each of the constants by looking at the source ...

96. Calendar class should not do this. I think.    coderanch.com

Calendar.getTime() returns a Date object. The problem is this: Class Date doesn't know anything about timezones. A Date object only contains the number of milliseconds since a particular point in time (January 1, 1970, 12:00 AM GMT). If you print a Date object with System.out.println(), then it will be printed in the default timezone of the computer - which is your ...

97. Java Calendar issue    coderanch.com

I have this problem with the java Calendar. Here is the code break down: Calendar startDate = GreogrianCalendar.getInstance(tz); //tz = time zone instance (GMT -7) in my case startDate.getTime(startDateFromDB); // startDateFromDB is a Date from database (August 14th, 2008); System.out.println(startDate.getTime().toString()); startDate.set(Calendar.HOUR_OF_DAY, 18); // Set time to 6:00PM (GMT -7) System.out.println(startDate.getTime().toString()); The output: Thu Aug 14 00:00:00 EDT 2008 Thu Aug 13 ...

98. create calendar java    coderanch.com

something along tghese lines should do it (no guarantees though!) you just need a single array 49 elements (for a 7 x 7 grid) or you could use a 2D array load the first 7 (0 to 6) with the days of the week Sun, Mon etc important to make them "Sun ", "Mon " - if no space they'll run ...

99. Problem with Calendar class    coderanch.com

100. Slightly confused about Calendar Object    coderanch.com

Slightly confused about Calendar Object This bit of code is supposed to check whether a certain point in time (lastRefresh) is before now. note: lastRefresh is the result of a new java.util.Date() that was initialised earler. Calendar lastRefreshCal = Calendar.getInstance(); lastRefreshCal.setTime(lastRefresh); lastRefreshCal.set(Calendar.HOUR, 0); lastRefreshCal.set(Calendar.MILLISECOND, 0); lastRefreshCal.set(Calendar.MINUTE, 0); lastRefreshCal.set(Calendar.SECOND, 0); Calendar today = Calendar.getInstance(); today.setTime(new java.util.Date()); today.set(Calendar.HOUR, 0); today.set(Calendar.MILLISECOND, 0); today.set(Calendar.MINUTE, 0); ...