Reference > Expressions > Built-in Functions > Date Functions > DatePart

DatePart

Returns the requested part (such as day, second, or quarter) of the local date.

Syntax

DatePart(part,date)

Enabled for

Search/Dashboard No
Business Rules Yes
Quick Actions Yes
Workflow Objects Yes
Reports No

Parameters

part

The part of the day to return. Must be surrounded by quotes (" "). The following types are supported:

  • millisecond
  • second
  • minute
  • hour
  • day
  • weekday: 1 (Sunday) through 7 (Saturday)
  • dayofyear: 1 through 365/366
  • month: 1 through 12
  • quarter: 1 through 4
  • year

date

The date for which you want to return a part.

Return Value

Number value.

Example

$(DatePart("day",CreatedDate()))

If CreatedDate() = Dec 9, 2013, this example returns 9 because the input has 9 for the value of the day.

Another example:

DatePart() Example