Date and Time Functions Flashcards
YEARFRAC(start_date, end_date, basis)
Calculates the fraction of the year represented by the number of whole days between two dates. Use the YEARFRAC worksheet function to identify the proportion of a whole year’s benefits or obligations to assign to a specific term.
DATEVALUE(date_text)
Converts a date in text format to a date in datetime format.
TIMEVALUE(time_text)
Converts a time in text format to a time in datetime format.
TIME(hour, minute, second)
Converts hours, minutes, and seconds given as numbers to a time in datetime format.
WEEKDAY(date, return_type)
Returns a number from 1 to 7 identifying the day of the week of a date. By default the day ranges from 1 (Sunday) to 7 (Saturday).
CALENDARAUTO([fiscal_year_end_month])
Returns a table with a single column named “Date” that contains a contiguous set of dates. The range of dates is calculated automatically based on data in the model.
CALENDAR(start_date, end_date)
Returns a table with a single column named “Date” that contains a contiguous set of dates. The range of dates is from the specified start date to the specified end date, inclusive of those two dates.
NOW()
Returns the current date and time in datetime format.
TODAY()
Returns the current date.
UTCNOW()
Returns the current UTC date and time.
UTCTODAY()
Returns the current UTC date.
EOMONTH(start_date, months)
Returns the date in datetime format of the last day of the month, before or after a specified number of months. Use EOMONTH to calculate maturity dates or due dates that fall on the last day of the month.
EDATE(start_date, months)
Returns the date that is the indicated number of months before or after the start date. Use EDATE to calculate maturity dates or due dates that fall on the same day of the month as the date of issue.
DAY(date)
Returns the day of the month, a number from 1 to 31.
HOUR(datetime)
Returns the hour as a number from 0 (12:00 A.M.) to 23 (11:00 P.M.).
MINUTE(datetime)
Returns the minute as a number from 0 to 59, given a date and time value.
MONTH(datetime)
Returns the month as a number from 1 (January) to 12 (December).
DATEDIFF(Date1, Date2, Interval)
Returns the number of interval boundaries between two dates.
NETWORKDAYS(start_date, end_date[, weekend, holidays])
Returns the number of whole workdays between two dates (inclusive). Parameters specify which and how many days are weekend days. Weekend days and days specified as holidays are not considered as workdays.
QUARTER(date)
Returns the quarter as a number from 1 (January – March) to 4 (October – December).
SECOND(time)
Returns the seconds of a time value, as a number from 0 to 59.
DATE(year, month, day)
Returns the specified date in datetime format.
WEEKNUM(date[, return_type])
Returns the week number for the given date according to the return_type value. The week number indicates where the week falls numerically within a year.
YEAR(date)
Returns the year of a date as a four digit integer in the range 1900-9999.