Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2025.0.0 - English


caldays

create a calendarDuration in days

calmonths

create a calendarDuration in months

calyears

create a calendarDuration in years

Syntax

c = caldays(x)
c = calmonths(x)
c = calyears(x)

Arguments

x

real scalar or matrix

c

calendarDuration object

Description

c = caldays(x) creates a calendarDuration in days of the same size as the input argument x.

If x is a calendarDuration, then caldays(x) returns a matrix of reals.

It is the same for the other functions.

Examples

// calendarDuration in days
c = caldays(1:31)
c = caldays([1; 5; 8; 11; 17])

// calendarDuration in months
c = calmonths(1:12)
c = calmonths([6 7; 11 12])

// calendarDuration in years
c = calyears(2000:4:2030)
c = calyears([1985 1987;2014 2018])

c1 = calendarDuration(2000, 1, 1, 12, 30, 00)
c2 = calyears(2000) + calmonths(1) + caldays(1) + hours(12) + minutes(30)
c1 == c2

See also

  • calendarDuration — create a calendarDuration - duration in days, months and years
  • duration — create a duration - duration in hours, minutes and seconds
  • datetime — create points in time

History

VersionDescription
2024.0.0 Introduction in Scilab.
Report an issue
<< Time and Date Time and Date calendar >>

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 Oct 24 11:13:10 CEST 2024