May 2022
Intermediate to advanced
688 pages
20h 12m
English
The Date object is more of a timestamp than a conventional date. A timestamp is what you see when you call toString() on a Date, so that is what you have in each of your RecyclerView rows. While timestamps make for good documentation, it might be nicer if the rows just displayed the date as humans think of it – like “May 11, 2022.” You can do this with an instance of the android.text.format.DateFormat class. The place to start is the reference page for this class in the Android documentation.
You can use functions in the DateFormat class to get a common format. Or you can prepare your own format string. For a more advanced challenge, create a format string that will display the day of the week as well ...
Read now
Unlock full access