Skip to main content
Version: Next

VP SET DATE VALUE

VP SET DATE VALUE ( rangeObj : Object ; dateValue : Date { ; formatPattern : Text } )

ParameterTypeDescription
rangeObjObject->Range object
dateValueDate->Date value to set
formatPatternText->Format of value

Description

The VP SET DATE VALUE command assigns a specified date value to a designated cell range.

In rangeObj, pass a range of the cell(s) whose value you want to specify. If rangeObj includes multiple cells, the value specified will be repeated in each cell.

The dateValue parameter specifies a date value to be assigned to the rangeObj.

The optional formatPattern defines a pattern for the dateValue parameter. Pass any custom format or you can use one of the following constants:

ConstantDescriptionDefault US pattern
vk pattern long dateISO 8601 format for the full date"dddd, dd MMMM yyyy"
vk pattern month dayISO 8601 format for the month and day"MMMM dd"
vk pattern short dateAbbreviated ISO 8601 format for the date"MM/dd/yyyy"
vk pattern year monthISO 8601 format for the month and year"yyyy MMMM"

For information on patterns and formatting characters, please refer to the Date and time formats section.

Example

//Set the cell value to the current date
VP SET DATE VALUE(VP Cell("ViewProArea";4;2);Current date))

//Set the cell value to a specific date with a designated format
VP SET DATE VALUE(VP Cell("ViewProArea";4;4);Date("12/25/94");"d/m/yy ")
VP SET DATE VALUE(VP Cell("ViewProArea";4;6);!2005-01-15!;vk pattern month day)

See also

4D View Pro cell format
VP SET DATE TIME VALUE
VP SET VALUE