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 trialWan Nor Adzahari Wan Tajuddin
2,438 PointsWhy my timestamp isn't showing correctly?
Please look at my code. http://w.trhou.se/caq80ndaxu
The timestamp that was printed out for my first treet is Sun Jan 18 07:27:27 UTC 1970
The timestamp that was printed out for my second treet is Mon Jan 19 09:55:41 UTC 1970
My epoch timestamp for the first treet is 1495647480L.
My epoch timestamp for the second treet is 1590941249L which is supposed to be in the year 2020 as opposed to 1970!
1 Answer
Fahad Mutair
10,359 Pointshi Wan Nor Adzahari Wan Tajuddin , Epoch timestamp it should be in milliseconds not Seconds
so you have to add 3 zero at the end 1590941249L (sec) = 1590941249000L (ms)
The class Date represents a specific instant in time, with millisecond precision