FormatDateTime ใน vb.net มีอยู่หลากหลายรูปแบบแล้วแต่การใช้งาน มาดูกันว่ามี Format แบบไหนบ้าง

Private Sub textbox_show()
        Dim test_date As Date = Now
        Me.txtD1.Text = Format(test_date, "dd/MM/yyyy")
        Me.txtD2.Text = Format(test_date, "d-M-yy")
        Me.txtD3.Text = Format(test_date, "MMM dd yyyy")
        Me.txtD4.Text = Format(test_date, "dd MMMM yyyy")
        Me.txtD5.Text = Format(test_date, "dd MMMM yyyy HH:mm:ss:fff")

        Me.txtD6.Text = FormatDateTime(test_date, DateFormat.GeneralDate)
        Me.txtD7.Text = FormatDateTime(test_date, DateFormat.LongDate)
        Me.txtD8.Text = FormatDateTime(test_date, DateFormat.LongTime)
        Me.txtD9.Text = FormatDateTime(test_date, DateFormat.ShortDate)
        Me.txtD10.Text = FormatDateTime(test_date, DateFormat.ShortTime)
End Sub





         Download Semple Coding in vb.net Project
http://www.mediafire.com/download/5t15vd05vvnzrne/Windows_Date.zip


** บทความที่เกี่ยวข้อง **
แสดงรูปแบบวันที่ ค.ศ. และ พ.ศ. VB.NET
Convers String to Date in vb.net
DateAdd แสดงการเพิ่มวันที่และช่วงเวลา
บวก ลบ วันที่ / DateDiff เปรียบเทียบวันที่และเวลา
FormatDateTime
รูปแบบวันที่ เพิ่มเติม