Core Java 结合 android 新发现(一)

来源:互联网 发布:网络保密管理规定 编辑:程序博客网 时间:2024/06/06 16:51

对于时间格式化显示问题

  • string.xml
<string name="now_time">当前时间是:%1$tF %1$tR</string>
  • textview
TextView view = (TextView)findViewById(R.id.helloworld);view.setText(getResources().getString(R.string.now_time, new Date()));
  • 结果
    这里写图片描述

  • 常用时间格式
    这里写图片描述

这里写图片描述

0 0
原创粉丝点击