Export (0) Print
Expand All

Predefined Date/Time Formats (Format Function) 

The following table identifies the predefined date and time format names. These may be used by name as the style argument for the Format function:

Format Name Description

General Date, or G

Displays a date and/or time. For example, 4/3/93 05:34 PM. Date display is determined by your application's current culture value.

Long Date, Medium Date, or D

Displays a date according to your current culture's long date format.

Short Date, or d

Displays a date using your current culture's short date format.

Long Time, Medium Time, or T

Displays a time using your current culture's long time format; typically includes hours, minutes, seconds.

Short Time, or t

Displays a time using your current culture's short time format.

f

Displays the long date and short time according to your current culture's format.

F

Displays the long date and long time according to your current culture's format.

g

Displays the short date and short time according to your current culture's format.

M, m

Displays the month and the day of a date.

R, r

Formats the date and time as Greenwich Mean Time (GMT).

s

Formats the date and time as a sortable index.

u

Formats the date and time as a GMT sortable index.

U

Formats the date and time with the long date and long time as GMT.

Y, y

Formats the date as the year and month.

For more information about the application's current culture information, see How Culture Affects Strings in Visual Basic.

Namespace: Microsoft.VisualBasic

Module: Strings

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

Community Additions

ADD
Show:
© 2015 Microsoft