Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2025.1.0 - Русский


day

extracts day from datetime

Syntax

d = day(dt, dayType)

Arguments

dt

datetime

dayType

string with possible values: "dayofmonth" (default value), "dayofweek", "iso-dayofweek", "dayofyear", "name" and "shortname"

d

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

Description

d = day(dt) returns the day value(s) of the input argument dt.

d = day(dt, dayType) returns the day value(s) or day name(s) depending on dayType:

  • "dayofmonth", day-of-month values (default)

  • "dayofyear", day-of-year value, from 1 to 365 or 366.

  • "dayofweek", day-of-week value, from 1 to 7, where 1 corresponds to "Sunday"

  • "iso-dayofweek", day-of-week value, from 1 to 7, according to the ISO 8601 standard, where 1 corresponds to "Monday"

  • "name", full day names. If dt contains NaT values, they will be replaced by "".

  • "shortname", abbreviated day names. If dt contains NaT values, they will be replaced by "".

Examples

Extracts day values from dt

dt = datetime(2025, 2, 5)
d = day(dt)

dt = datetime(2025, 3, 15):caldays(20):datetime(2025, 7, 26)
d = day(dt)

With "dayofyear" keyword

dt = datetime()
d = day(dt, "dayofyear")

With "dayofweek", "iso-dayofweek", "name" and "shortname" keyword

dt = datetime(2025, 6, 14)
d = day(dt, "dayofweek")
d = day(dt, "iso-dayofweek")
d = day(dt, "name")
d = day(dt, "shortname")

dt = datetime(2024, 2, 27):caldays(2):datetime(2024, 3, 2)
d = day(dt, "dayofweek")
d = day(dt, "iso-dayofweek")
d = day(dt, "name")
d = day(dt, "shortname")

See also

History

ВерсияОписание
2025.1.0 Introduction in Scilab.
Report an issue
<< datevec Time and Date duration >>

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:55:27 CEST 2025