[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Calendar in Java

Posted on 2006-03-22
7
Medium Priority
?
289 Views
Last Modified: 2010-03-31
In Java , I would like to determine if a 'Monday' is the first or second etc.

How do we do that. We have the Calendar. WeekOfMonth. That will give us only the week number of a day.

thanks in advance
0
Comment
Question by:expertsit
7 Comments
 
LVL 92

Expert Comment

by:objects
ID: 16263110
Use Calendar.DAY_OF_WEEK and Calendar.DATE
0
 
LVL 13

Expert Comment

by:Kelvin_King
ID: 16264077
These links have some examples on getting the day of the week

http://www.rgagnon.com/javadetails/java-0100.html
http://javaalmanac.com/egs/java.util/GetDaysInMonth.html

Also, the Calendar API has more functions which you can use.

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html
0
 
LVL 9

Accepted Solution

by:
Manikandan Thiagarajan earned 375 total points
ID: 16264396
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:expertsit
ID: 16270224
Thanks to you all.
0
 
LVL 92

Expert Comment

by:objects
ID: 16275282
how is that different from what I and Kelvin_King already suggested?
0
 

Author Comment

by:expertsit
ID: 16275373
Ok. When I went back to my question this morning, there were several replies to it. I went through the sites mentioned and found answer to my problem.
I then clicked the 'Accept Answer' to one of them. (I could not accept multiple answers).

That is why I mentioned 'Thanks to you all' in my comments.

0
 
LVL 92

Expert Comment

by:objects
ID: 16275416
thanks for the clarification :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month18 days, 2 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question