<< datevec Data e Hora duration >>

Scilab Help >> Data e Hora > day

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:

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

VersionDescription
2025.1.0 Introduction in Scilab.

Report an issue
<< datevec Data e Hora duration >>