# weekday

**Syntax**

weekday(X, [startFromSunday=true])

**Arguments**

X is a temporal scalar/vector.

startFromSunday is a Boolean value indicating whether a week starts from Sunday. The default value is true. If startFromSunday=false, a week starts from Monday.

**Details**

Return integer(s) to represent of the corresponding weekday(s) of X.

If startFromSunday=true, 0 means Sunday, 1 means Monday, …, and 6 means Saturday.

If startFromSunday=false, 0 means Monday, 1 means Tuesday, …, and 6 means Sunday.

**Examples**

```
$ weekday 2012.12.05;
3
$ weekday(2012.12.05, false);
2
$ weekday 2013.05.23T12:00:00;
4
$ weekday(2014.01.11T23:04:28.113);
6
$ weekday 2012.12.05 2012.12.06 2013.01.05;
[3,4,6]
```