hi can anyone help me? how can i convert to time if i inputted 2400 it should 12:00 then a running a time?

for example i have 1 textbox

if i input 2300

it should 11:00

how can i do this in timer? thanks

Recommended Answers

All 3 Replies

how is doing that in a timer going to work? The math behind converting the times is simple.... subtract 12, and make it PM if the number is greater than 12...

I guess you want to count-down a specified number of hours (and minutes).

You may do this as following:
1- Make a variable (lets say X)
2- Set the value of variable to the entered number of minutes (text1.text * 60 / 100)
3- Use timer with 60000 as interval (= one minute)
4- Let the timer subtract 1 from X each time it passes one minute
5- When X = 0, Trigger whatever you want...

I'm not sure why you're using a timer, but you can format time in 12 or 24 hour formats with the Format function - Format(Time$, "hh:mm:ss") or Format(Time$, "hh:mm:ss AMPM")

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.