Date Functions |
Return to the Index |
DATE | DATEDIF | DATEVALUE | DAY | HOUR | MINUTE | MONTH | NOW | SECOND | TIME | TIMEVALUE | TODAY | WEEKDAY | WEEKNUM | YEAR |
DATE |
Returns a date specified by the given arguments.
Syntax:DATE(year, month, day)
year is number representing the year. If < 1900 then 1900 is added to the number. Example:date(2003, 11, 2) equals Nov. 2, 2003 |
DATEDIF |
Returns the number of time intervals between two dates.
Note: positive value returned when date2 > date1.
Interval Description -------- ----------- y Returns the number of years. m Returns the number of months. d Returns the number of days. ym Returns the number of months (day and year ignored). yd Returns the number of days (year ignored). md Returns the number of days (month and year ignored). Syntax:DATEDIF(date1, date2, interval)
date1 and date2 is any date. Example:datedif("3/1/00", "8/2/03", "yd") equals 154 |
DATEVALUE |
Converts a string to a date.
Syntax:DATEVALUE(date_text)
date_text is a string that represents a date. Example:month(datevalue("3/1/00") |
DAY |
Returns the day given a date.Syntax:DAY(date)
date is any date. Example:day(date(2003, 11, 2)) equals 2 |
HOUR |
Returns the hour given a date.Syntax:HOUR(date)
date is any date. Example:hour(timevalue("3:37 PM")) equals 15 |
MONTH |
Returns the month given a date.Syntax:MONTH(date)
date is any date. Example:month(now()) equals 9 |
NOW |
Returns the current date and time.Syntax:NOW()
|
TIME |
Returns a date specified by the given arguments with just the time values set.Syntax:TIME(hour, minute, second)
hour is a number from 0 to 23. Example:time(4, 5, 6) equals 6 |
TIMEVALUE |
Converts a string to a date with just the time values set.Syntax:TIMEVALUE(time_text)
time_text is a string that represents a time. Syntax:Example:timevalue("3:37 PM") |
TODAY |
Returns the current date.Syntax:TODAY()
|
YEAR |
Returns the year given a date.Syntax:YEAR(date)
date is any date. Example:year(datevalue("3/1/00")) equals 2000 |
SECOND |
Returns the second given a date.Syntax:SECOND(date)
date is any date. Example:second(time(4, 5, 6)) equals 6 |
WEEKDAY |
Returns the weekday given a date.Syntax:WEEKDAY(date,return_type)
date is any date. Example:weekday(date(2003, 11, 2)) equals 1 |
WEEKNUM |
Returns the weeknum given a date.Syntax:WEEKNUM(date,firstDay)
date is any date. Example:WEEKNUM(3) equals 2 |