Java求解,下面语句中的2$tB表示什么意思?
答案:2 悬赏:50 手机版
解决时间 2021-01-05 14:41
- 提问者网友:轮囘Li巡影
- 2021-01-05 02:57
Java求解,下面语句中的2$tB表示什么意思?
最佳答案
- 五星知识达人网友:低音帝王
- 2021-01-05 04:32
首先是是日期转换符的应用,d转化为两位数字的日
依据参数索引将字符串格式化的操作方式,以‘%’开始,以‘$’结束,‘%’之后的2表示的是第二个参数。
依据参数索引将字符串格式化的操作方式,以‘%’开始,以‘$’结束,‘%’之后的2表示的是第二个参数。
全部回答
- 1楼网友:青灯有味
- 2021-01-05 05:51
对日期类型
This conversion may be applied to long, Long, Calendar, and Date.
't'
'\u0074'
Prefix for date and time conversion characters.
'T'
'\u0054'
The upper-case variant of 't'.
The following date and time conversion character suffixes are defined
for the 't' and 'T' conversions. The types are similar to
but not completely identical to those defined by GNU date and
POSIX strftime(3c). Additional conversion types are provided to
access Java-specific functionality (e.g. 'L' for milliseconds
within the second).
The following conversion characters are used for formatting times:
'H'
'\u0048'
Hour of the day for the 24-hour clock, formatted as two digits with
a leading zero as necessary i.e. 00 - 23. 00
corresponds to midnight.
'I'
'\u0049'
Hour for the 12-hour clock, formatted as two digits with a leading
zero as necessary, i.e. 01 - 12. 01 corresponds to
one o'clock (either morning or afternoon).
'k'
'\u006b'
Hour of the day for the 24-hour clock, i.e. 0 - 23.
0 corresponds to midnight.
'l'
'\u006c'
Hour for the 12-hour clock, i.e. 1 - 12. 1
corresponds to one o'clock (either morning or afternoon).
'M'
'\u004d'
Minute within the hour formatted as two digits with a leading zero
as necessary, i.e. 00 - 59.
'S'
'\u0053'
Seconds within the minute, formatted as two digits with a leading
zero as necessary, i.e. 00 - 60 ("60" is a special
value required to support leap seconds).
'L'
'\u004c'
Millisecond within the second formatted as three digits with
leading zeros as necessary, i.e. 000 - 999.
'N'
'\u004e'
Nanosecond within the second, formatted as nine digits with leading
zeros as necessary, i.e. 000000000 - 999999999. The precision
of this value is limited by the resolution of the underlying operating
system or hardware.
'p'
'\u0070'
Locale-specific morning or afternoon marker
in lower case, e.g."am" or "pm". Use of the
conversion prefix 'T' forces this output to upper case. (Note
that 'p' produces lower-case output. This is different from
GNU date and POSIX strftime(3c) which produce
upper-case output.)
'z'
'\u007a'
RFC 822
style numeric time zone offset from GMT, e.g. -0800. This
value will be adjusted as necessary for Daylight Saving Time. For
long, Long, and Date the time zone used is
the default time zone for this
instance of the Java virtual machine.
'Z'
'\u005a'
A string representing the abbreviation for the time zone. This
value will be adjusted as necessary for Daylight Saving Time. For
long, Long, and Date the time zone used is
the default time zone for this
instance of the Java virtual machine. The Formatter's locale will
supersede the locale of the argument (if any).
's'
'\u0073'
Seconds since the beginning of the epoch starting at 1 January 1970
00:00:00 UTC, i.e. Long.MIN_VALUE/1000 to
Long.MAX_VALUE/1000.
'Q'
'\u004f'
Milliseconds since the beginning of the epoch starting at 1 January
1970 00:00:00 UTC, i.e. Long.MIN_VALUE to
Long.MAX_VALUE. The precision of this value is limited by
the resolution of the underlying operating system or hardware.
The following conversion characters are used for formatting dates:
'B'
'\u0042'
Locale-specific full month name, e.g. "January", "February".
'b'
'\u0062'
Locale-specific abbreviated month name,
e.g. "Jan", "Feb".
'h'
'\u0068'
Same as 'b'.
'A'
'\u0041'
Locale-specific full name of the day of the week,
e.g. "Sunday", "Monday"
'a'
'\u0061'
Locale-specific short name of the day of the week,
e.g. "Sun", "Mon"
'C'
'\u0043'
Four-digit year divided by 100, formatted as two digits
with leading zero as necessary, i.e. 00 - 99
'Y'
'\u0059' Year, formatted to at least
four digits with leading zeros as necessary, e.g. 0092 equals
92 CE for the Gregorian calendar.
'y'
'\u0079'
Last two digits of the year, formatted with leading zeros as
necessary, i.e. 00 - 99.
'j'
'\u006a'
Day of year, formatted as three digits with leading zeros as
necessary, e.g. 001 - 366 for the Gregorian calendar.
001 corresponds to the first day of the year.
'm'
'\u006d'
Month, formatted as two digits with leading zeros as necessary,
i.e. 01 - 13, where "01" is the first month of the
year and ("13" is a special value required to support lunar
calendars).
'd'
'\u0064'
Day of month, formatted as two digits with leading zeros as
necessary, i.e. 01 - 31, where "01" is the first day
of the month.
'e'
'\u0065'
Day of month, formatted as two digits, i.e. 1 - 31 where
"1" is the first day of the month.
The following conversion characters are used for formatting common
date/time compositions.
'R'
'\u0052'
Time formatted for the 24-hour clock as "%tH:%tM"
'T'
'\u0054'
Time formatted for the 24-hour clock as "%tH:%tM:%tS".
'r'
'\u0072'
Time formatted for the 12-hour clock as "%tI:%tM:%tS
%Tp". The location of the morning or afternoon marker
('%Tp') may be locale-dependent.
'D'
'\u0044'
Date formatted as "%tm/%td/%ty".
'F'
'\u0046'
ISO 8601
complete date formatted as "%tY-%tm-%td".
'c'
'\u0063'
Date and time formatted as "%ta %tb %td %tT %tZ %tY",
e.g. "Sun Jul 20 16:17:00 EDT 1969".
This conversion may be applied to long, Long, Calendar, and Date.
't'
'\u0074'
Prefix for date and time conversion characters.
'T'
'\u0054'
The upper-case variant of 't'.
The following date and time conversion character suffixes are defined
for the 't' and 'T' conversions. The types are similar to
but not completely identical to those defined by GNU date and
POSIX strftime(3c). Additional conversion types are provided to
access Java-specific functionality (e.g. 'L' for milliseconds
within the second).
The following conversion characters are used for formatting times:
'H'
'\u0048'
Hour of the day for the 24-hour clock, formatted as two digits with
a leading zero as necessary i.e. 00 - 23. 00
corresponds to midnight.
'I'
'\u0049'
Hour for the 12-hour clock, formatted as two digits with a leading
zero as necessary, i.e. 01 - 12. 01 corresponds to
one o'clock (either morning or afternoon).
'k'
'\u006b'
Hour of the day for the 24-hour clock, i.e. 0 - 23.
0 corresponds to midnight.
'l'
'\u006c'
Hour for the 12-hour clock, i.e. 1 - 12. 1
corresponds to one o'clock (either morning or afternoon).
'M'
'\u004d'
Minute within the hour formatted as two digits with a leading zero
as necessary, i.e. 00 - 59.
'S'
'\u0053'
Seconds within the minute, formatted as two digits with a leading
zero as necessary, i.e. 00 - 60 ("60" is a special
value required to support leap seconds).
'L'
'\u004c'
Millisecond within the second formatted as three digits with
leading zeros as necessary, i.e. 000 - 999.
'N'
'\u004e'
Nanosecond within the second, formatted as nine digits with leading
zeros as necessary, i.e. 000000000 - 999999999. The precision
of this value is limited by the resolution of the underlying operating
system or hardware.
'p'
'\u0070'
Locale-specific morning or afternoon marker
in lower case, e.g."am" or "pm". Use of the
conversion prefix 'T' forces this output to upper case. (Note
that 'p' produces lower-case output. This is different from
GNU date and POSIX strftime(3c) which produce
upper-case output.)
'z'
'\u007a'
RFC 822
style numeric time zone offset from GMT, e.g. -0800. This
value will be adjusted as necessary for Daylight Saving Time. For
long, Long, and Date the time zone used is
the default time zone for this
instance of the Java virtual machine.
'Z'
'\u005a'
A string representing the abbreviation for the time zone. This
value will be adjusted as necessary for Daylight Saving Time. For
long, Long, and Date the time zone used is
the default time zone for this
instance of the Java virtual machine. The Formatter's locale will
supersede the locale of the argument (if any).
's'
'\u0073'
Seconds since the beginning of the epoch starting at 1 January 1970
00:00:00 UTC, i.e. Long.MIN_VALUE/1000 to
Long.MAX_VALUE/1000.
'Q'
'\u004f'
Milliseconds since the beginning of the epoch starting at 1 January
1970 00:00:00 UTC, i.e. Long.MIN_VALUE to
Long.MAX_VALUE. The precision of this value is limited by
the resolution of the underlying operating system or hardware.
The following conversion characters are used for formatting dates:
'B'
'\u0042'
Locale-specific full month name, e.g. "January", "February".
'b'
'\u0062'
Locale-specific abbreviated month name,
e.g. "Jan", "Feb".
'h'
'\u0068'
Same as 'b'.
'A'
'\u0041'
Locale-specific full name of the day of the week,
e.g. "Sunday", "Monday"
'a'
'\u0061'
Locale-specific short name of the day of the week,
e.g. "Sun", "Mon"
'C'
'\u0043'
Four-digit year divided by 100, formatted as two digits
with leading zero as necessary, i.e. 00 - 99
'Y'
'\u0059' Year, formatted to at least
four digits with leading zeros as necessary, e.g. 0092 equals
92 CE for the Gregorian calendar.
'y'
'\u0079'
Last two digits of the year, formatted with leading zeros as
necessary, i.e. 00 - 99.
'j'
'\u006a'
Day of year, formatted as three digits with leading zeros as
necessary, e.g. 001 - 366 for the Gregorian calendar.
001 corresponds to the first day of the year.
'm'
'\u006d'
Month, formatted as two digits with leading zeros as necessary,
i.e. 01 - 13, where "01" is the first month of the
year and ("13" is a special value required to support lunar
calendars).
'd'
'\u0064'
Day of month, formatted as two digits with leading zeros as
necessary, i.e. 01 - 31, where "01" is the first day
of the month.
'e'
'\u0065'
Day of month, formatted as two digits, i.e. 1 - 31 where
"1" is the first day of the month.
The following conversion characters are used for formatting common
date/time compositions.
'R'
'\u0052'
Time formatted for the 24-hour clock as "%tH:%tM"
'T'
'\u0054'
Time formatted for the 24-hour clock as "%tH:%tM:%tS".
'r'
'\u0072'
Time formatted for the 12-hour clock as "%tI:%tM:%tS
%Tp". The location of the morning or afternoon marker
('%Tp') may be locale-dependent.
'D'
'\u0044'
Date formatted as "%tm/%td/%ty".
'F'
'\u0046'
ISO 8601
complete date formatted as "%tY-%tm-%td".
'c'
'\u0063'
Date and time formatted as "%ta %tb %td %tT %tZ %tY",
e.g. "Sun Jul 20 16:17:00 EDT 1969".
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯