473,397 Members | 2,077 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

datetimepicker - set hours and minutes

Hi,
I have a datetimepicker , format set to time
and two strings, the first give me a hour lke "5" and the other the minutes
like "15"
How can i put these two values in the datetimepicker ?
Thanks for any response

Nov 20 '05 #1
2 19751
Andreas,
Have you tried

Dim picker as DateTimePicker

picker.Value = New DateTime(0, 0, 0, 9, 30, 0)

To set the DateTimePicker to 9:30 AM.

In other words set the Value property to a DateTime that has only a Time in
it.

Hope this helps
Jay

"andreas" <an*****@pandora.be> wrote in message
news:Z4**********************@phobos.telenet-ops.be...
Hi,
I have a datetimepicker , format set to time
and two strings, the first give me a hour lke "5" and the other the minutes like "15"
How can i put these two values in the datetimepicker ?
Thanks for any response


Nov 20 '05 #2
* "andreas" <an*****@pandora.be> scripsit:
I have a datetimepicker , format set to time
and two strings, the first give me a hour lke "5" and the other the minutes
like "15"
How can i put these two values in the datetimepicker ?


\\\
Dim d As Date = Me.DateTimePicker1.Value
Me.DateTimePicker1.Value = New Date(d.Year, d.Month, d.Day, CInt("5"), CInt("15"), 0)
///

Set the datetimepicker's 'Format' property to 'Custom' and the
'CustomFormat' property to a string containing "HH:mm".

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Shaun | last post by:
Hi, I have a table called Bookings which has two important columns; Booking_Start_Time and Booking_End_Time. These columns are both of type DATETIME. Given any day how can I calculate how many...
2
by: J M | last post by:
I rebooted a network device just few minutes ago and getting device-up-time value 3191. How do I convert a time elapsed in days hours minutes and seconds for above value? Example: This device...
22
by: Drum2001 | last post by:
I have a table that tracks employee times. I have a column (Date/Time). Users, through a form, enter how long it takes them to complete a task. For example, 03:45 = 3 hours and 45 mins. I am...
5
by: Lad | last post by:
Hello, what is the best /easest way how to get number of hours and minutes from a timedelta object? Let's say we have aa=datetime.datetime(2006, 7, 29, 16, 13, 56, 609000)...
1
by: baneaic | last post by:
I'm trying to create a form that will allow a user to enter certain job specifications (# of pages and # of copies) and then have a field that will automatically calculate how long that job will...
0
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I have a DateTimePicker set to the custom format HH:mm:ss. (I used the custom format to avoid the AM/PM part, even though my OS is set up for the 12-hour time format.) It works fine...
1
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I posted this about a month ago but didn't get any response, so I thought I'd rephrase it. I have a DateTimePicker set for Up/Down Time format (HH:mm:ss). The problem is that when I...
6
by: richbneal | last post by:
I really like the site so far and this is my first post. I have looked through some of the archives with no luck. I have also read the posting guidelines and will do my best to be clear and accurate...
11
by: jessy | last post by:
Hi, I have a problem with my DateTimePicker javascript code which i downloaded , the problem is when i pick the date and the date appears in my Text Field and i click Submit the date which i picked...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.