Date problem

Hi all, I want to create a Calendar in jsp. I want to find out on what "day" would the "first" of a month occur. Also, is there any way of finding number of weeks in a month ?
[196 byte] By [geetuR] at [2007-9-26 2:30:28]
# 1

Hi geetur,

I am giving you related code what you are trying to get.

I hope this will help you out.

Code for calender:

=============

<html>

<head>

<title>Calendar demo</title>

</head>

<body bgcolor="white">

<%@ page language="java" import="HtmlCalendar" %>

<jsp:useBean id="HtmlCal" scope="session" class="HtmlCalendar" />

<%

// set parameters

HtmlCal.setMonth(6);

HtmlCal.setAction(24,"http://coldjava.hypermart.net","_blank");

%>

<table width=300>

<tr><td nowrap>

<%=HtmlCal.getHtml()%>

</td></tr>

</table>

</body>

</html>

Still if you have any doubts please post the query.

Regards,

Tirumalarao.

Developer Technical Support,

Sun Microsystems,India.

rao_indts at 2007-6-29 9:49:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hi,

Did you copy your code suggestion from http://coldjava.hypermart.net/servlets/htmlcal.htm

If yes, you could have atleast pointed out that the corresponding JavaBean HTMLCalendar's class file can be downloaded from http://coldjava.hypermart.net/servlets/HtmlCalendar.class

neville_sequeira at 2007-6-29 9:49:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

First, Thanks so much for the prompt reply.

I want to create the calendar myself, since it involves a lot of DB access in it. I just want to know how to get about it..

I am mostly using the Calendat functions to find out the number of days in a month, etc. I wud like to know, how to get the number of weeks in a month and the day the first of a month falls on.

Thanks for all.

geetuR at 2007-6-29 9:49:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Have you read the Javadoc for java.util.Calendar yet ?
neville_sequeira at 2007-6-29 9:49:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Yes, I have...
geetuR at 2007-6-29 9:49:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
Then you have solved it, right!If not yet, look critically to all the getter methods. The field may be initialy a bit confusing, but just do some simple programs (tutorials on net!) - that will help.
Dipanc at 2007-6-29 9:49:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

geetuR,

You have asked the same/similar question on another forum. Haven't you. I have provided a detailed answer with code over there.

By the way, are you really able to manage following up properly on potential answers to same questions you pose on multiple forums. Would it not be better to just posr the tpoic on only one forum that you think is most suitable ?

neville_sequeira at 2007-6-29 9:49:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...