Jan 2, 2003 #1 sthmpsn1 MIS Sep 26, 2001 456 US I am trying to format the current date to a format like "mm/dd/yyyy" I am using the following code thedate.text = setdate.ToString("mm/dd/yyyy" this is the result it is giving me. 00/02/2003. Why the 00??? Any help would be great. Scott
I am trying to format the current date to a format like "mm/dd/yyyy" I am using the following code thedate.text = setdate.ToString("mm/dd/yyyy" this is the result it is giving me. 00/02/2003. Why the 00??? Any help would be great. Scott
Jan 2, 2003 #2 bradlkm Programmer Dec 18, 2002 35 US Scott, In your date format string, you use lowercase m's, which correspond to minutes. Try uppercase M's for the month: thedate.text = setdate.ToString("MM/dd/yyyy" (I have to admit it tripped me up the first time I used it too!) HTH Kevin B. .Net Programmer Upvote 0 Downvote
Scott, In your date format string, you use lowercase m's, which correspond to minutes. Try uppercase M's for the month: thedate.text = setdate.ToString("MM/dd/yyyy" (I have to admit it tripped me up the first time I used it too!) HTH Kevin B. .Net Programmer
Jan 2, 2003 Thread starter #3 sthmpsn1 MIS Sep 26, 2001 456 US Thanks Kevin. I knew it was something simple!! sCOTT Upvote 0 Downvote
Jan 3, 2003 #4 Zarcom Programmer May 7, 2002 1,275 CA If you are using the date type then you can also use. datevar.toshortdatestring The date type also has a few other built in formats That'l do donkey, that'l do Mark If you are unsure of forum etiquette check here faq796-2540 Upvote 0 Downvote
If you are using the date type then you can also use. datevar.toshortdatestring The date type also has a few other built in formats That'l do donkey, that'l do Mark If you are unsure of forum etiquette check here faq796-2540