Time and Date Time Picker

Randino

New Member
Joined
May 13, 2016
Messages
2
Greetings of the day,

I've got a DTP control on my user form and the format is set to 2-dtp-Time. It currently displays 12:00:00 AM when I change the time to say 9:00:00 AM and display the results with Time = DTPTime.Value i get 8/8/2016 9:00:00 AM. What I want is just the time 9:00:00 AM, preferably in decimal form, e.g. 09:15:00 AM = 09.25
 
An idea towards approaching this...

On a new sheet, put 8/8/2016 9:15:00 AM into cell B2 and run this
Code:
Sub ChangeTimeDisplay()

    Dim dte As Date
    Dim dteTIME As Date
    
dte = Range("B2").Value
dteTIME = Format(dte, "h:mm")
MsgBox dteTIME * 24

End Sub
 
Upvote 0
THANK YOU!!!!!
the Format is the key!!!
I used Format(screen1.Time, "H:M") the capital H converts the hours to a 2400 clock
(I created lets and gets in my user from object and instantiated)
Then as I keep experimenting it evolved to
dim dStartTime as Double
dStartTime = Hour(screen1.Time) + (Minute(screen1.Time) / 60)
the format was the break through. Thank You Thank You Thank You
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top