Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Get the Day of today?

Posted on 1999-09-26
6
Medium Priority
?
244 Views
Last Modified: 2010-04-16
I want to know is there any method in Java 1.1 that can help us find the day of today? For example, today is 27 September, 1999, and it should be Monday. Can it easily return the day of 1st October, 2000 etc. Another other method else? Thanks!
0
Comment
Question by:mscproj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Author Comment

by:mscproj
ID: 2076689
In fact, I just want to know the first day of each month, eg: 1st of January,1999, 1st of October, 2003......
0
 

Author Comment

by:mscproj
ID: 2076695
In fact, I just want to know the first day of each month, eg: 1st of January,1999, 1st of October, 2003......
0
 
LVL 1

Expert Comment

by:ylyip
ID: 2076784
I have the same problem as you. The getDay() function of the class java.util.Date is deprecated, but I cannot find an equivalent in newer SDK...
0
Technology Partners: 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!

 
LVL 4

Accepted Solution

by:
pagladasu earned 200 total points
ID: 2076787
Don't forget to - import java.util.*;

String days[]={"","Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
GregorianCalender cal=new GregorianCalender();
cal.set(2000,0,1); //1st Jan 2000 AD in YYYY, MM(Jan=0), DD format
System.out.println("Day is :"+days[cal.get(Calender.DAY_OF_WEEK)]);

hope this helps,
pagladasu
0
 

Author Comment

by:mscproj
ID: 2077012
Thanks!
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6833025
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

705 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