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 trialKhongor Battogtokh
2,563 PointsDays 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
1 Answer
Victor Cuc
7,281 PointsHi! 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);
}
Victor Cuc
7,281 PointsVictor Cuc
7,281 PointsI have the same error, but mine shows 2 saturdays and 6 sundays instead. Weird...