Date formats reference

Build 1501 on 14/Nov/2017  This topic last edited on: 11/Mar/2015, at 18:49

The conversion of date value, in:

dim datevariable as date = Now

sformat = sFormat

msgbox (datevariable.ToString(sFormat))

or in

Text="{Binding Path=[linkObject.modifiedDate], Converter={StaticResource StringFormatValueConverter}, ConverterParameter=\{0:sFormat\}}" />

The results are:

sFormat

Result

d

11/05/2007

D

May 11, 2007

t

9:09 PM

T

9:09:27 PM

f

May 11, 2007 9:09 PM

F

May 11, 2007 9:09:27 PM

g

11/05/2007 9:09 PM

G

11/05/2007 9:09:27 PM

M

May 11

R

Fri, 11 May 2007 21:09:27 GMT

s

2007-05-11T21:09:27

u

2007-05-11 21:09.27z

U

May 12, 2007 4:09:27 AM

y

May, 2007

dd

11

ddd

Fri

dddd

Friday

HH:mm:ss.fff z

21:09:69.275 -7

yy/MM/dd g

07/05/11 A.D.

Other examples

See http://www.java2s.com/Tutorial/VB/0100__Date-Time/Useformatspecifierstocontrolthedatedisplay.htm