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.).