Display date in dd/mm/yyyy format in vb.net
问题 I want to display date in 09/07/2013 format instead of 09-jul-13. Dim dt As Date = Date.Today MsgBox(dt) 回答1: First, uppercase MM are months and lowercase mm are minutes. You have to pass CultureInfo.InvariantCulture to ToString to ensure that / as date separator is used since it would normally be replaced with the current culture's date separator: MsgBox(dt.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture)) Another option is to escape that custom format specifier by embedding the / within