DateTimeFormat Property
The DateTimeFormat property returns or sets the date formatting for labels.
Syntax
object.DateTimeFormat
object.DateTimeFormat = DateTimeFormat
Parameter |
Type |
Description |
DateTimeFormat |
String |
required; date/time format |
Example
This example shows how to set the date format for a label.
' Sets the date/time format to display as full month name and four-digit year
LabelFormat.DateTimeFormat = "MMMM yyyy"
Example 2
This example shows how to return the date format for a label to the Immediate Pane.
'Return the date format string to the Immediate Pane
Debug.Print LabelFormat.DateTimeFormat
Used by: LabelFormat Object