Created
June 14, 2016 04:18
-
-
Save talhahasanzia/e17b5b4c04b3df945179c493dbce752d to your computer and use it in GitHub Desktop.
Get current date in android.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
long date = System.currentTimeMillis(); | |
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy"); // or MMM MM dd, yyyy h:mm a to get time also | |
String dateString = sdf.format(date); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment