Table of contents
TOC
Collapse the table of content
Expand the table of content

Application.DateFormat Method (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Returns a date in the specified format.

Syntax

expression. DateFormat( ** Date, ** Format )

expression A variable that represents an Application object.

Parameters

NameRequired/OptionalData TypeDescription
DateRequiredVariantThe date to format.
FormatOptionalLongThe 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
© 2018 Microsoft