Home All Groups Group Topic Archive Search About

Setting Time property

Author
27 Nov 2006 12:09 PM
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

Author
27 Nov 2006 12:43 PM
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!

--
"si_owen" <s.o***@sstaffs.gov.uk> wrote in message
news:1164629379.984639.268880@n67g2000cwd.googlegroups.com...
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
Author
27 Nov 2006 12:57 PM
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
Author
27 Nov 2006 1:18 PM
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

-----
d will equal December 12, 2006 at midnight.

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

--
"si_owen" <s.o***@sstaffs.gov.uk> wrote in message
news:1164632264.282373.188010@l12g2000cwl.googlegroups.com...
I want the format to be HH:MM no days month or year just the time and
set to midnight in the code