2013-07-30 108 views
-4

試圖讓我日起按以下格式:日期格式需要(VB)

2013年7月30日

請幫助。 試圖在谷歌上找到答案,並找不到我需要的完全匹配。我確定這對你的專業人士來說很簡單。

+0

你試過了什麼,你讀過什麼文件? –

+0

谷歌顯示解決方案的數量在搜索輸入中輸入「vb.net中的日期格式」.. http://www.dotnetperls.com/datetime-format-vbnet –

+0

標準http://msdn.microsoft.com/en- us/library/az4se3k1.aspx定製http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx – dbasnett

回答

2

使用String.Format

String.Format("{0:MMMM dd, yyyy}", #07/30/2013#) 

DateTime.ToString

Dim d = #07/30/2013# 
d.ToString("MMMM dd, yyyy") 

有關選項的完整列表,看看Custom Date and Time Format Strings

+0

非常感謝! – Scott

1
DateTime thisDate1 = new DateTime(2013, 7, 30); 
Console.WriteLine("Today is " + thisDate1.ToString("MMMM dd, yyyy") + "."); 

感謝, Jagjot

1

yourdate.ToString("MMMM dd, yyyy")