Microsoft Office Tutorials and References
In Depth Information
Creating your own date and time formats
Highlight the entry in the text box at the top of the Type list, and type the following
custom format code: dddd mmmm dd, yyyy h:mm:ss.0
4.
5. Click OK. Excel stores the new format in the Type list for the Custom category and
displays the date using the new format in the selected cell.
You can use the same procedure to display only a portion of the date or the time
information available. For example, if you create the format mmmm , Excel displays the date
2/24/2014 as simply February .
Table 15-1 shows the formatting codes you can use to create custom date and time
formats. Be sure to keep two facts in mind. First, Excel assumes that m means months, but if
you type the code m immediately after an h , or the code mm immediately after an hh ,
Excel displays minutes instead of months. Second, if you include one of the codes AM/PM,
am/pm, A/P, or a/p in a time format, Excel uses the 12-hour time convention; if you omit
these codes, Excel uses the 24-hour (military) time convention.
TABLE 15-1 Codes for creating custom date and time formats
Code
Display
General
Number in General (serial value) format.
d
Day number without leading zero (1–31).
dd
Day number with leading zero (01–31).
ddd
Day-of-week abbreviation (Sun–Sat).
dddd
Complete day-of-week name (Sunday–Saturday).
m
Month number without leading zero (1–12).
mm
Month number with leading zero (01–12).
mmm
Month name abbreviation (Jan–Dec).
mmmm
Complete month name (January–December).
yy
Last two digits of year number (00–99).
yyyy
Complete four-digit year number (1900–2078).
h
Hour without leading zero (0–23).
hh
Hour with leading zero (00–23).
m
Minute without leading zero (0–59).
mm
Minute with leading zero (00–59).
s
Second without leading zero (0–59).
ss
Second with leading zero (00–59).
s.0
Second and tenths of a second without leading zero.
s.00
Second without leading zero and hundredths of a second without leading
zero.
Search JabSto ::




Custom Search