# day, dow, dom, doy, dim, month, wom, woy, moy, wkday, year

### day(date)

Returns the day of the month of the specified date as a number. Similar to dom() and included for those who are used to dBase functions.

### dow() , dow(date), dow(dateStr)

Returns the day of week of the specified date as a number. When no argument is specified the current date is used.

### dom(), dom(date), dom(dateStr)

Returns the day of the month of the specified date as a number. When no argument is specified the current date is used.

### doy(), doy(date), doy(dateStr)

Returns the day of the year of the specified date as a number. When no argument is specified the current date is used.

### dim(), dim(date), dim(dateStr)

Returns as a number the amount of times the day of the week has appeared in the month of the specified date. When no argument is specified the current date is used.

### month(date)

Returns the month of the year of the specified date as a number. Similar to moy() and included for those who are used to dBase functions.

### wom(), wom(date), wom(dateStr)

Returns the week of the month of the specified date as a number. When no argument is specified the current date is used.

### woy() , woy(date), woy(dateStr)

Returns the week of the year of the specified date as a number. When no argument is specified the current date is used.

### moy() , moy(date), moy(dateStr)

Returns the month of the year of the specified date as a number. When no argument is specified the current date is used.

### wkday(), wkday(date), wkday(dateStr)

Returns the day of the week of the specified date as a word. When no argument is specified the current date is used.

### year(date)

Returns the year part of the specified date as a number.

## Arguments

Argument | Data Type | Description
none | none | Uses the current date
dateStr | string in format yyyyMMdd | Converts the string to a date then returns the appropriate value
date | date value | Uses the specified date value

## Returns

Date part of either current or specified date.

## Description

Used to return the specified date part. All return in number format with the exception of wkday(), which returns a string. The numeric value that is returned can be used in arithmetic operations.

If a date is to be specified as an argument then it can be in either date or string format. Only fields which contain either a date or a string representation of a date in the format "yyyyMMdd" can be used. See Date and Time Formatting. If another format is desired then the function should be used in conjunction with date(dateStr, dateFmt), or dtos(date, datefmt).

## Examples

Assume that the current date is October 15th 2001
Assume that field 1 holds the date value 20011023
Assume that field 2 holds the string value 19710704
Assume that field 3 holds the date value 25/12/00

Example | Returns | Description
doy() | 288 | The current day of the year as a number
dow() | 45 | The current week of the year as a number
dom() | 15 | The current day of the month
dow(#1) | 3 | The day of the week of the value in field 1
moy(#2) | 7 | The month of the year for the string in field 2
woy(date("04/07/71", "dd/MM/yy")) | 27 | Can be used with date function to utilise the desired format
dim(#3) | 4 | field3 is a date and not a string, so conversion is necessary
wkday("19680118") | Thu | The day of the week in words for the specified date in the required format
day(date()) | 15 | Returns the day of the month for the current date
month(date(#1, "yyyyMMdd")) | 10 | Returns the month of the year for the date in field1
year(date()) | 2001 | Returns the current year

## See Also

date(), dtos(), stod(), Date and time formatting