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) Lists with RecyclerViews Binding Data in the ViewHolder

no timezone needed here?

In our Day Class we also used timezone,

what is use of timezone?

1 Answer

Rex Wang
Rex Wang
2,089 Points

Time zone is used to retrieve the correct time. The time we get from the forecast api has the following description:

The UNIX time (that is, seconds since midnight GMT on 1 Jan 1970) at which this data point occurs

Since this is GMT time, we want to convert the time received to the one that matches the region with longitude/latitude we supplied to the API call. If you did the extra challenge of the first part of this course, then the time you will see in the app should match the current time on your machine

J A
seal-mask
.a{fill-rule:evenodd;}techdegree
J A
Full Stack JavaScript Techdegree Student 4,646 Points

If that is true, then why (using the exact same API response data) do we apply a time zone when getting the formatted of a Day object, but not of an Hour object? It seems inconsistent to me.