NSDateFormatter 格式整理(二)
with an era of BCE or CE. An extended year value for the Juliancalendar system assigns positive values to CE years and negativeva lues to BCE years, with 1 BCE being year 0.
quarter
Q
1..2
02
Quarter - Use one or two for the numerical quarter, three for theabbreviation, or four for the full name.
3
Q2
4
2nd quarter
q
1..2
02
Stand-Alone Quarter - Use one or two for the numericalquarter, three for the abbreviation, or four for the fullname.
3
Q2
4
2nd quarter
month
M
1..2
09
Month- Use one or two for the numerical month, three for theabbreviation, or four for the full name, or five for the narrowname.
3
Sept
4
September
5
S
L
1..2
09
Stand-Alone Month - Use one or two for the numerical month,three for the abbreviation, or four for the full name, or 5 for thenarrow name.
3
Sept
4
September
5
S
week
w
1..2
27
Week of Year.
W
1
3
Week of Month
day
d
1..2
1
Date - Day of the month
D
1..3
345
Day of year
F
1
2
Day of Week in Month. The example is for the 2nd Wed inJuly
g
1..n
2451334
Modified Julian day. This is different from the conventionalJulian day number in two regards. First, it demarcates days atlocal zone midnight, rather than noon GMT. Second, it is a localnumber; that is, it depends on the local time zone. It can bethought of as a single number that encompasses all the date-relatedfields.
week
day
E
1..3
Tues
Dayof week - Use one through three letters for the short day, or fourfor the full name, or five for the narrow name.
4
Tuesday
5
T
e
1..2
2
Localday of week. Same as E except adds a numeric value that will dependon the local starting day of the week, using one or two letters.For this example, Monday is the first day of the week.
3
Tues
4
Tuesday
5
T
c
1
2
Stand-Alone local day of week - Use one letter for the localnumeric value (same as 'e'), three for the short day, or four forthe full name, or five for the narrow name.
3
Tues
4
Tuesday
5
T
period
a
1
AM
AM or PM
hour
h
1..2
11
Hour [1-12].
H
1..2
13
Hour [0-23].
K
1..2
0
Hour [0-11].
k
1..2
24
Hour [1-24].
minute
m
1..2
59
Minute. Use one or two for zero padding.
second
s
1..2
12
Second. Use one or two for zero padding.
S
1..n
3457
Fractional Second - rounds to the count of letters. (example isfor 12.34567)
A
1..n
69540000
Milliseconds in day. This field behaves exactly like acomposite of all time-related fields, not including the zonefields. As such, it also reflects discontinuities of those fieldson DST transition days. On a day of DST onset, it will jumpforward. On a day of DST cessation, it will jump backward. Thisreflects the fact that is must be combined with the offset field toobtain a unique local time value.
zone
z
1..3
PDT
Timezone - Use one to three letters for the short timezone or fourfor the full name. For more information, see AppendixJ: Time Zone Display Names
4
Pacific DaylightTime
4
GMT-08:00
v
1
PT
Useone letter for short wall (generic) time, four for long wall time.For more information, see AppendixJ: Time Zone Display Names
4
Pacific Time
All non-letter character represent themselves in a pattern,except for the single quote. It is used to 'escape' letters. Twosingle quotes in a row, whether inside or outside a quotedsequence, represent a 'real' single quote.