extracts month from datetime
m = month(dt, monthType)
string with possible values: "monthofyear" (default value), "name" and "shortname"
month value(s) (double) or month name(s) (string)
m = month(dt) returns the month value(s) of the input argument
dt.
m = month(dt, monthType) returns the month value(s) or month name(s)
depending on monthType:
"monthofyear", month value(s) (default)
"name", full month name(s). If dt contains NaT values, they will be replaced by "".
"shortname", abbreviated month names. If dt contains NaT values, they will be replaced by "".
Extracts month value(s) from dt
dt = datetime(2025, 2, 5) m = month(dt) dt = datetime(2025, 3, 15):caldays(20):datetime(2025, 7, 26) m = month(dt) | ![]() | ![]() |
With "name" keyword
dt = datetime(2025, 2, 5) m = month(dt, "name") dt = datetime(2025, 3, 15):calmonths(2):datetime(2025, 9, 30) m = month(dt, "name") | ![]() | ![]() |
With "shortname" keyword
dt = datetime() m = month(dt, "shortname") | ![]() | ![]() |
| Version | Description |
| 2025.1.0 | Introduction in Scilab. |