beyondgrader.com Logo
DemoBrowseAboutTeamLogin

Format Date

Geoffrey Challen // 2020.10.0

Create a class named Formatter. Formatter should provide one public class method formatDate. It should accept a positive long representing milliseconds since 1970 and return a String containing the ISO-8601 representation of this time. Here is one example for a recent timestamp: given 1602106609897 your function should return 2020-10-07T21:36:49.897Z.

Do not overthink this. The solution we are after is a single line of code. We suggest that you explore the various built-in Java libraries for working with dates and times.