Skip to content

Date and time functions

swmal edited this page Apr 1, 2012 · 13 revisions

Date

Example: DATE(2012, 2, 2)

Day

Returns the day of month from the supplied date
Example: DAY(DATE(2012, 4, 2))

Hour

Example: HOUR(Time(12, 13, 14)

Minute

Example(time as serialnumber): MINUTE(Time(12, 13, 14))
Example(time as string): MINUTE('10:12:14')

Month

Example: MONTH(Date(2012, 4, 2))

Now

Example: NOW()

Second

Returns the second from a timestamp. The time can be a serial number from the TIME function or a string.

Example (time as serialnumber): SECOND(Time(12, 13, 59))
Example (time as string): SECOND('10:12:14')

Time

Example: TIME(12, 13, 14)

Today

Returns the date of today Example: TODAY()

Weekday

Returns an integer representation of the weekday of the supplied date. The second argument is an integer between 1 and 3 that controls how the weekdays are represented.
1 - Sunday = 1... Saturday = 7
2 - Monday = 1... Sunday = 7
3 - Monday = 0... Sunday = 6

Example: WEEKDAY(TODAY(), 2)

Year

Example: YEAR(NOW())


Home

Clone this wiki locally