| MATLAB Function Reference | ![]() |
Syntax
[N, S] = weekday(D) [N, S] = weekday(D, form) [N, S] = weekday(D, locale) [N, S] = weekday(D, form, locale)
Description
[N, S] = weekday(D)
returns the day of the week in numeric (N) and string (S) form for a given serial date number or date string D. Input argument D can represent more than one date in an array of serial date numbers or a cell array of date strings.
[N, S] = weekday(D, form)
returns the day of the week in numeric (N) and string (S) form, where the content of S depends on the form argument. If form is 'long', then S contains the full name of the weekday (e.g., Tuesday). If form is 'short', then S contains an abbreviated name (e.g., Tues) from this table.
The days of the week are assigned these numbers and abbreviations.
| N |
S (short) |
S (long) |
1 |
Sun |
Sunday |
2 |
Mon |
Monday |
3 |
Tue |
Tuesday |
4 |
Wed |
Wednesday |
5 |
Thu |
Thursday |
6 |
Fri |
Friday |
7 |
Sat |
Saturday |
[N, S] = weekday(D, locale)
returns the day of the week in numeric (N) and string (S) form, where the format of the output depends on the locale argument. If locale is 'local', then weekday uses local format for its output. If locale is 'en_US', then weekday uses US English.
[N, S] = weekday(D, form, locale)
returns the day of the week using the formats described above for form and locale.
Examples
See Also
| web | what | ![]() |
© 1994-2005 The MathWorks, Inc.