Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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);
    }