Testing and Using Custom Formats

Suppose you have a nonstandard date or number format that you want to use. Tables 3.2 and 3.3 help you understand the symbols used to create custom date and number formats.

Table 3.2. Date Formats
Symbol Represents
/ (slash), – (dash), or . (period) Separators to delimit date values
d Day of the month in numbers with no zero added for single digit days
dd Day of the month in numbers with zero added for single digit days
ddd The first three letters of the weekday (Sun through Sat)
dddd The full name of the weekday (Sunday through Saturday)
w Day of the week (1–7)
ww Week of the year (1–53)
m Month of the year in numbers with no zero added for single digit months
mm Month of the year in numbers with zero added ...

Get Access 2002 Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.