Skip to content

Instantly share code, notes, and snippets.

@WrathChaos
Last active May 29, 2021 15:37
Show Gist options
  • Save WrathChaos/c30b7b267887df05c5736e6f5383f80a to your computer and use it in GitHub Desktop.
Save WrathChaos/c30b7b267887df05c5736e6f5383f80a to your computer and use it in GitHub Desktop.
How to convert timestamp to formatted date on Android? Article: https://freakycoder.com/android-notes-45-how-to-convert-timestamp-to-formatted-date-d69848648e3
Calendar cal = Calendar.getInstance(Locale.ENGLISH);
cal.setTimeInMillis(timestamp);
String date = DateFormat.format("dd-MM-yyyy hh:mm:ss", cal).toString();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment