Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

datetimepicker formats

Posted on 2005-04-26
4
Medium Priority
?
907 Views
Last Modified: 2012-06-27
Hi,

I hope this is a stupid question and I will be able to get on with life quickly!

It seems that no matter how I specify a format for a datetimepicker control, it shows up with the date as well as the time.

Is there some obvious oversight that causes this?  I can give examples but am hoping that this is an easy one.

Thanks
zoseri
0
Comment
Question by:zoseri
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
ddunlea earned 900 total points
ID: 13870273
Hi zoseri,

The following works fine for me:

            timeControl = new DateTimePicker();
            timeControl.Format = DateTimePickerFormat.Custom;
            timeControl.CustomFormat = "HH:mm";
           
Regards
0
 
LVL 21

Assisted Solution

by:Yurich
Yurich earned 600 total points
ID: 13872084
The same can be done in the design view - select your control, hit F4 and in the properties set Format to Custome and in the CustomFormat type in HH:mm:ss or whatever

regards
0
 

Author Comment

by:zoseri
ID: 13881838
Maybe my problem is that I am putting the date into a textbox?

For some of my date fields, the date is FYI only so I put it into
a ReadOnly textbox...when I do a ToString on the date, even
though a Custom Format is used, does the format not get
taken into account?

Thx again
0
 

Author Comment

by:zoseri
ID: 13917882
Thanks guys.  It seems after all that the problem was when I tried to put the data into a textbox...so the datetimepickers do work fine and I just strip off any unwanted parts in the string sent to textbox...

I'll split points anyway
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

575 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question