Android开发之java代码中获取当前系统的时间工具类

/**
	 * 获取当前时间
	 * 
	 * @return
	 */
	public String getTime() {
		Date date = new Date();// 创建一个时间对象,获取到当前的时间
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 设置时间显示格式
		CurrentTime = sdf.format(date);

		return CurrentTime;
	}

程序员小冰博客:http://blog.csdn.net/qq_21376985 技术交流QQ986945193 微博:http://weibo.com/mcxiaobing
原文地址:https://www.cnblogs.com/mcxiaobing/p/5472096.html