Setting Time property

S

si_owen

Hi all,

I have a db that records time in the minutes that have passed midnight.

I need to pull this back and put it into correct time hh:mm

Can anyone help me with setting up the initial time to midnight??

Thanks in Advance,

Simon
 
R

Ryan S. Thiele

do you mean format it?

Format(TheReturnedTime, "HH:MM")

Or do you want to add time?

dim d as new date(year, month, day, hour, minute, second)

Then you can add minutes...

d = d.addminutes(NumberOfMinutes)

Or you need the difference in two dates:

dim d as Date = DateDiff(DateInterval, Date1, Date2)

--
Thiele Enterprises - The Power Is In Your Hands Now!

--
Hi all,

I have a db that records time in the minutes that have passed midnight.

I need to pull this back and put it into correct time hh:mm

Can anyone help me with setting up the initial time to midnight??

Thanks in Advance,

Simon
 
S

si_owen

I want the format to be HH:MM no days month or year just the time and
set to midnight in the code
 
R

Ryan S. Thiele

There is no time class so I would use the date class. You just don't use the
year, month, or day. Only use them to delcare the date, but after that, you
can use the hours, minutes, and seconds.

VB2005:
dim d as date = Today

VB2003:
dim d as date = Now.Today
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top