SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");Date curDate = new Date(System.currentTimeMillis());String date = formatter.format(curDate);

三个步骤,获取系统的日期和时间。

"yyyy-MM-dd HH:mm:ss" :为时间日期格式,yyyy MM dd HH mm ss分别对应年月日小时分钟秒,格式可以自定义方式,或者只显示日期或者时间。

更多相关文章

  1. Android 球形进度条,动态控制时间与最大进度
  2. Android Stuido第五期 - 时间选择器
  3. Android 使用正则表达式验证邮箱格式是否正确
  4. Android自定义view七时间轴(三)---纵向的图表时间轴
  5. Android 中日期控件与下拉列表的使用
  6. Android - 浅谈获取时间
  7. android中系统日期时间的获取

随机推荐

  1. android WindowManager可拖动悬浮按钮
  2. Xamarin 中开发Android实现全屏或者不显
  3. Android 查询字段
  4. Android中智能控件AutoCompleteTextView
  5. Android -- 加载大图片的方法
  6. Android(安卓)第八天_重置版_服务_注意事
  7. Android开发学习 之 一、开发环境的搭建
  8. Dojo mobile TweetView 系列教程之五 —
  9. Android(安卓)Webview 开发详解
  10. Android该系统提供的服务--Vibrator(振子