Skip to content

Instantly share code, notes, and snippets.

@semihozkoroglu
Last active December 18, 2015 14:09
Show Gist options
  • Save semihozkoroglu/5795403 to your computer and use it in GitHub Desktop.
Save semihozkoroglu/5795403 to your computer and use it in GitHub Desktop.
Current Timestamp to datetime
Date date = new Date(System.currentTimeMillis());
DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Commons.infoLog("hm", df.format(date));
-------------------------
DateFormat dateFormat = new SimpleDateFormat("hh:mm:ss");
String currentTime = dateFormat.format(SystemClock.uptimeMillis());
Commons.infoLog("hm", currentTime);
http://www.mysamplecode.com/2012/03/java-get-current-date-time.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment