Back to project page Geek-Coder-News.
The source code is released under:
MIT License
If you think the Android project Geek-Coder-News listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.geekcoder.util; /*from w w w . j a v a2 s. c o m*/ import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; /** * @Author SunnyCoffee * @Date 2014-1-28 * @version 1.0 * @Desc ???? */ public class Utils { public static String getCurrentTime(String format) { Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault()); String currentTime = sdf.format(date); return currentTime; } public static String getCurrentTime() { return getCurrentTime("yyyy-MM-dd HH:mm:ss"); } }