format date to show month,day double digit
-
Monday, July 09, 2012 10:17 PM
Hi,
I have a datepicker control formatted as a updown.
this.dateTimePicker1.ShowUpDown = true;
this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
Custom format :
ci = Application.CurrentCulture;
format = ci.DateTimeFormat.ShortDatePattern + " HH:mm:ss";This format shows me 10/ 1/2010 00:00:00
How would I get a 10/01/2010(display mm/dd/yyyy, format date to show month,day double digit
Thank u
Sun
sunDisplay
All Replies
-
Tuesday, July 10, 2012 2:04 AM
- Edited by ProgrammingVolunteerMVP Tuesday, July 10, 2012 2:05 AM
- Edited by ProgrammingVolunteerMVP Tuesday, July 10, 2012 2:06 AM
- Proposed As Answer by Bob Wu-MTMicrosoft Contingent Staff, Moderator Thursday, July 12, 2012 7:08 AM
- Marked As Answer by Bob Wu-MTMicrosoft Contingent Staff, Moderator Friday, July 27, 2012 9:25 AM
-
Tuesday, July 10, 2012 4:54 AM
Hi,
I would need this as a dynamic format based on the culture. So cannot hard code it in Custom Format
Sun
sunDisplay
-
Tuesday, July 10, 2012 5:01 AM
I would need this as a dynamic format based on the culture. So cannot hard code it in Custom Format
In a button's Click or somewhere else, do this plz——
dateTimePicker1.Format = DateTimePickerFormat.Custom; dateTimePicker1.CustomFormat = "mm/dd/yyyy HH:mm:ss";
- Proposed As Answer by Bob Wu-MTMicrosoft Contingent Staff, Moderator Thursday, July 12, 2012 7:08 AM
- Unproposed As Answer by Bob Wu-MTMicrosoft Contingent Staff, Moderator Thursday, July 12, 2012 7:09 AM
-
Thursday, July 12, 2012 7:15 AMModerator
Hi,
I would need this as a dynamic format based on the culture. So cannot hard code it in Custom Format
Sun
sunDisplay
Hi Sun,
I get confused. If you want the date display according to culture, then don't do anything. If you want to display date in your way, then you need custom format.
Could you please explain what do you mean by dynamic format?
Best Regards,
Bob Wu [MSFT]
MSDN Community Support | Feedback to us
-
Thursday, July 12, 2012 7:28 AM
I would need this as a dynamic format based on the culture. So cannot hard code it in Custom Format
So u can just dynamically setting the CustomFormat, Mine is only a sample. In fact u can do setting in a TextBox and assign to the CustomFormat property……


