Application.DateFormat Method (Project)

Returns a date in the specified format.

Syntax

expression .DateFormat(Date, Format)

expression A variable that represents an Application object.

Parameters

Name

Required/Optional

Data Type

Description

Date

Required

Variant

The date to format.

Format

Optional

Long

The date format. Can be one of the PjDateFormat constants. The default value is pjDateDefault.

Return Value

Variant

Example

The following example displays the start of the selected task using the format "1/31/02 12:33 PM."

Sub OutputDate() 
 MsgBox DateFormat(ActiveCell.Task.Start, pjDate_mm_dd_yy_hh_mmAM) 
End Sub