Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2025.1.0 - 日本語


month

extracts month from datetime

Syntax

m = month(dt, monthType)

Arguments

dt

datetime

monthType

string with possible values: "monthofyear" (default value), "name" and "shortname"

m

month value(s) (double) or month name(s) (string)

Description

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 "".

Examples

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")

See also

History

バージョン記述
2025.1.0 Introduction in Scilab.
Report an issue
<< isnat Time and Date NaT >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu May 22 12:57:11 CEST 2025