Posted by: Red Souldier | January 15, 2010

VB.NET Date Time Format Patterns

Standard Format Example List:

Format Code Result
MM/dd/yyyy Date.Now().ToString(“d”) 1/15/2010
dddd, dd MMMM yyyy Date.Now().ToString(“D”) Friday, January 15, 2010
dddd, dd MMMM yyyy hh:mm tt Date.Now().ToString(“f”) Friday, January 15, 2010 11:06 AM
dddd, dd MMMM yyyy HH:mm:ss Date.Now().ToString(“F”) Friday, January 15, 2010 11:06:46 AM
MM/dd/yyyy h:mm tt Date.Now().ToString(“g”) 1/15/2010 11:06 AM
MM/dd/yyyy HH:mm:ss Date.Now().ToString(“G”) 1/15/2010 11:06:46 AM
MMMM dd Date.Now().ToString(“m”) January 15
dd MMM yyyy HH’:’mm’:’ss ‘GMT’ Date.Now().ToString(“r”) Fri, 15 Jan 2010 11:06:46 GMT
yyyy’-‘MM’-‘dd’T’HH’:’mm’:’ss Date.Now().ToString(“s”) 2010-01-15T11:06:46
yyyy’-‘MM’-‘dd HH’:’mm’:’ss’Z’ Date.Now().ToString(“u”) 2010-01-15 11:06:46Z
dddd, MMMM dd yyyy HH:mm:ss Date.Now().ToString(“U”) Friday, January 15, 2010 3:06:46 AM
yyyy MMMM Date.Now().ToString(“y”) January, 2010

Read More Complete List >>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: