M MFRASER Jan 14, 2004 #1 How do I format a string to contain 0 place holders? I want the following string "1/1/2001" to look like "01/01/2001"
How do I format a string to contain 0 place holders? I want the following string "1/1/2001" to look like "01/01/2001"
A Amalorpavanathan Y \(AMAL\) Jan 14, 2004 #2 Hi, Use the following line of code Convert.ToDateTime("01/01/2001").ToString("MM/dd/yyyy"); Regards, Amal
Hi, Use the following line of code Convert.ToDateTime("01/01/2001").ToString("MM/dd/yyyy"); Regards, Amal
F Fraser Michael Jan 15, 2004 #3 Is there a way to code this so that the date will reflect the region of the computer? for example US = "mm/dd/yyyy" Mex = "dd/mm/yyyy" etc
Is there a way to code this so that the date will reflect the region of the computer? for example US = "mm/dd/yyyy" Mex = "dd/mm/yyyy" etc
J Jon Skeet [C# MVP] Jan 15, 2004 #4 Fraser Michael said: Is there a way to code this so that the date will reflect the region of the computer? for example US = "mm/dd/yyyy" Mex = "dd/mm/yyyy" Click to expand... Yes - look up "standard date and time format strings" in the MSDN index.
Fraser Michael said: Is there a way to code this so that the date will reflect the region of the computer? for example US = "mm/dd/yyyy" Mex = "dd/mm/yyyy" Click to expand... Yes - look up "standard date and time format strings" in the MSDN index.