tonofsteel Posted August 6, 2003 Posted August 6, 2003 I am trying to set my start time in a DateTimePicker control to 00:00 with the 24 hour clock. I cannot change the time no matter what I do, it just tells me it is read only, or it could not convert the string to a datetime. So do you have to use the time NOW, or can it be selected at run time programatically??? StartTime.CustomFormat = "yyyy-M-d:HH:mm" EndTime.CustomFormat = "yyyy-M-d:HH:mm" StartTime.Value = Convert.ToDateTime(DateTime.Today & ":00:00") Quote
*Experts* Bucky Posted August 6, 2003 *Experts* Posted August 6, 2003 The Value and CustomFormat properties are not read-only, so you should not have a problem setting them. You will have to format the date to your custom format: StartTime.Value = Convert.ToDateTime(DateTime.Today.ToString("yyyy-M-d:HH:mm")) Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.