Windows Develop Bookmark and Share   
 index > Windows Forms General > datetime format yyyy-MM-dd hh:mm AM/PM
 

datetime format yyyy-MM-dd hh:mm AM/PM

How can I display datetime in

yyyy-MM-dd hh:mm AM/PM

format using VB.net ??
bilalso  Wednesday, September 07, 2005 8:19 PM
Dim TmpTime as DateTime = DateTime.Now
MessageBox.Show(TmpTime.ToString("yyyy-MM-dd hh:mm tt"))

produces

---------------------------

---------------------------
2005-09-08 08:14 AM
---------------------------
OK  
---------------------------

Look here for more formatting patterns

MarcD  Thursday, September 08, 2005 1:13 PM
Dim TmpTime as DateTime = DateTime.Now
MessageBox.Show(TmpTime.ToString("yyyy-MM-dd hh:mm tt"))

produces

---------------------------

---------------------------
2005-09-08 08:14 AM
---------------------------
OK  
---------------------------

Look here for more formatting patterns

MarcD  Thursday, September 08, 2005 1:13 PM

You can use google to search for other answers

Custom Search

More Threads

• Programmatically loading comboBox and selecting the value.
• Combobox.SelectedValue Fails To Set valu
• problem with MHT file has been created from local HTML files
• VC#: Saving ComboBox display when we go to back/forward forms
• windows forms maximize issue
• MessageBox in BeforeSelect causes BeforeSelect to be fired multiple times.
• to check the file is in use +C#
• TextBox & Japanese Display
• Slope Curve like Gradient
• Inconsistent Print Coordinates Cont.