Android TextClock时间格式
下面所有的地方都用了format12Hour和format24Hour是为了忽略系统时间格式,不管系统是12小时制还是24小时制,都能正常显示时间
xml
<TextClock
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:format12Hour="yyyy年MM月dd日 EEEE aa HH:mm:ss"
android:format24Hour="yyyy年MM月dd日 EEEE aa HH:mm:ss" />
效果
![](https://img.haomeiwen.com/i1722765/7245378fefb9f8ab.png)
image.png
格式 |
效果 |
yyyy年MM月dd日 |
2020年11月17日 |
yyyy/MM/dd |
2020/11/17 |
yyyy-MM-dd |
2020-11-17 |
EEEE |
星期二 |
EEE |
周二 |
aa |
下午 |
HH:mm:ss |
15:53:05 |
hh:mm:ss |
03:53:05 |
本文标题:Android TextClock时间格式
本文链接:https://www.haomeiwen.com/subject/tyitzktx.html
网友评论