Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8947271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:42:54+00:00 2026-06-15T12:42:54+00:00

I have a class where I need to keep track of 7 date objects,

  • 0

I have a class where I need to keep track of 7 date objects, one for each day of the week that holds a time.

I set up a calendar like this and assign it to a Date object

Calendar cal = Calendar.getInstance();

cal.set(Calendar.HOUR_OF_DAY,0);
cal.set(Calendar.MINUTE,30);
cal.set(Calendar.SECOND,0);
cal.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);

Date FridayOpen = cal.getTime();

Log.i("Creation Day", String.valueOf(FridayOpen.toString()));

Log.i("Creation Day2", String.valueOf(FridayOpen.getDay()));

And the LogCat results are

Creation Day = Fri Dec 07 00:30:00 CST 2012

Creation Day2 = 5

WHY IS IT RETURNING 5 when Friday is clearly day 6 and stored in my Date Object? I can’t switch Calendar.DAY_OF_WEEK when the date is off. I’ve spent hours on this stupid problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:42:56+00:00Added an answer on June 15, 2026 at 12:42 pm

    Because days are from 0 to 6 .
    0 for Sunday and 6 for Saturday.

    Edit getDay() Method is Deprecated use Calendar.get(Calendar.DAY_OF_WEEK).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have class grades that I need to check if a specific grade is
I have a class that I need to perform some actions on but I
I have a class that I need to be able to serialize to a
I need to return two values at a time, so I have: class IterableObject(object):
I have a lightweight class I use to keep keep track of who the
Ok, i have a need to be able to keep track of value type
I'm relatively new to Ruby. I need to keep track of a day of
I have a class that has a static reference to Spring's ApplicationContext. I need
I can understand why you would need a class variable to keep track of
I need to have a class which extends view that overrides the onSizeChanged method

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.