p:子午线小写('am'或'pm'),根据地区文件
P:子午线大写('AM'或'PM'),根据地区文件
s:秒,无前导零
ss:秒,1位数时用前导零填充
i:分钟,无前导零
ii:分钟,1位数时用前导零填充
h:小时,无前导零,24小时格式
hh:小时,1位数时用前导零填充,24小时形式
H:小时,无前导零,12小时格式
HH:小时,1位数时用前导零填充,12小时格式
d:天,无前导零
dd:天,1位数时用前导零填充
m:月份,没有前导零
mm:月份,1位数时用前导零填充
M:简短的文本表示的一个月,如Jan
MM:完整的文本表示的一个月,如January
yy:年的两位数表示
yyyy:年的全数字表示,4位
英文原文:
p : meridian in lower case ('am' or 'pm') - according to locale file
P : meridian in upper case ('AM' or 'PM') - according to locale file
s : seconds without leading zeros
ss : seconds, 2 digits with leading zeros
i : minutes without leading zeros
ii : minutes, 2 digits with leading zeros
h : hour without leading zeros - 24-hour format
hh : hour, 2 digits with leading zeros - 24-hour format
H : hour without leading zeros - 12-hour format
HH : hour, 2 digits with leading zeros - 12-hour format
d : day of the month without leading zeros
dd : day of the month, 2 digits with leading zeros
m : numeric representation of month without leading zeros
mm : numeric representation of the month, 2 digits with leading zeros
M : short textual representation of a month, three letters
MM : full textual representation of a month, such as January or March
yy : two digit representation of a year
yyyy : full numeric representation of a year, 4 digits
startView、minView、maxView属性说明:
// 0 or 'hour' for the hour view--选择分钟的视图
// 1 or 'day' for the day view--选择小时的视图
// 2 or 'month' for month view--选择日期的视图
// 3 or 'year' for the 12-month overview--选择月份的视图
// 4 or 'decade' for the 10-year overview. Useful for date-of-birth datetimepickers.--选择年份的视图
showMeridian属性说明:
showMeridian如果为true,则会将时间拆成上午和下午(不管你用的是HH还是hh格式都会被拆成12小时制展示),如果为false则不拆成上午和下午。