Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Android Lists and Adapters (2015) Using Parcelable Data Retrieving Parcelable Data

Khongor Battogtokh
Khongor Battogtokh
2,563 Points

Days of the week

So i tried to run the app but instead showing days of the it only shows 5 Sunday and 3 Monday. Could not find the error

Victor Cuc
Victor Cuc
7,281 Points

I have the same error, but mine shows 2 saturdays and 6 sundays instead. Weird...

1 Answer

Victor Cuc
Victor Cuc
7,281 Points

Hi! I might have the solution you are looking for. (If you haven't already figured it out)

I think you might have multiplied time by 100 instead of 1000.

    public String getDayOfTheWeek() {
        SimpleDateFormat formatter = new SimpleDateFormat("EEEE");
        formatter.setTimeZone(TimeZone.getTimeZone(timezone));
        Date dateTime = new Date(time*1000);    // I had 100 here

        return formatter.format(dateTime);
    }