时间格式

Date & Time Patterns

2019-10-12

Itsycal can optionally accept a datetime pattern which it will use to show the current date and/or time next to its icon in the menu bar. Here are some examples:

Pattern Result
E, d-MMM H:mm Fri, 13-Jan 21:54
EEEE h:mm a Friday 9:54 PM

The table below shows some of the most useful characters used in datetime patterns. Characters may be used multiple times. For example, if y is used for the year, yy might produce 17 whereas yyyy produces 2017. For most numerical fields, the number of characters specifies the field width. For example, if h is the hour, h might produce 5 but hh produces 05. For some characters, the count specifies whether an abbreviated or full form should be used.

Symbol Occurrences Example
Year y 1..n 1996
Month M 1..2 09
3 Sept
4 September
5 S
Week of Year w 1..2 27
Week of Month W 1 3
Day of the Month d 1..2 31
Day of the Week E 1..3 Tues
4 Tuesday
5 T
AM or PM a 1 AM
Hour [1-12] h 1..2 11
Hour [0-23] H 1..2 13
Minute m 1..2 59
Second s 1..2 59

Two single quotes (eg. '') represents a literal single quote, either inside or outside single quotes. Text within single quotes is not interpreted in any way (eg. 'o''clock' is replaced with o'clock). Otherwise all ASCII letters from a-z and A-Z are reserved as syntax characters, and require quoting if they are to represent literal characters.

A full description of datetime patterns can be found in the Unicode Local Data Markup Language.


文章作者: Licardo
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 Licardo !
评论
 上一篇
对医学人才培养过程的想法 对医学人才培养过程的想法
对医学人才培养过程的想法 2019-10-23 今年暑假我参加了暑期剑桥项目,在英国度过了为期16天的学习生活。作为学院的出国交流的本科生,而且是一名少数民族同学,我此次出国的收获很大,而且对于本科阶医学人才的培养有了自己一定的想法。 英
2019-10-23
下一篇 
《老男孩》吉他谱 《老男孩》吉他谱
《老男孩》吉他谱 2019-10-07 《老男孩》这首经典的歌曲只要是在21世纪有过青春的人都不会陌生,而《老男孩》这首曲子也成了学吉他的人必会弹得一手曲子。 《老男孩》有指弹版,但是我要分享的是和弦版的谱子。不知道为啥,我个人觉得和弦版
2019-10-07
  目录