Function | Description | Example | Result |
---|---|---|---|
date(year, month, day) | The date, given the year, month and day of the month. | date(2009, 9, 8) | 20090908 |
dateadd(date, days) | Adds days to the date and returns a date, YYYYMMDD (ISO 8601). | dateadd(20090101, 251) | 20090909 |
day(date) | The day of the month for a given date value, YYYYMMDD (ISO 8601). | day(20090908) | 8 |
days(startdate, enddate) | The number of actual days between two dates. | days(20090101, 20090909) | 251 |
days360(startdate, enddate, method) | The number of days between two dates, using the 360 day year. Method can be constants calc (spreadsheet compatible = 0), euro (european = 1), or nasd (US, without spreadsheet bugs = -1). Try the example with 'nasd' method to demonstrate the spreadsheet bug. | days360(20070228, 20080229, calc) | 359 |
month(date) | The month of a given date value, YYYYMMDD (ISO 8601). | month(20090908) | 9 |
today() | Returns today's date as YYYYMMDD (ISO 8601). | today() | |
weekday(date) | The day of the week (Monday = 1, Sunday = 7) for a given date value, YYYYMMDD (ISO 8601). | weekday(20090909) | 3 |
year(date) | The year of a given date value, YYYYMMDD (ISO 8601). | year(20090908) | 2009 |
CALC 1 uses the ISO 8601 YYYYMMDD format for entering dates. This is a common date format that most users around the world are familiar with.
For example, April 28, 2004 is entered as 40428. June 4, 2018 is entered as 180604.
If you omit the first two years (the century) of YYYY, CALC 1 will use the current century, 20. This is a common truncated representation.
If you omit the entire YYYY, CALC 1 will use the current year.