Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with time format

Status
Not open for further replies.

trimakassi

Programmer
Aug 5, 2005
20
MA
hi all,
I have a database with a field configured to accept date/time. I am more interested in the time part of the entry.

the problem that i am facing is that I always get 12:00AM

can't figure it out!!
 
I always get 12:00AM

How are you putting the date into the database? Are you building a date in code (like 05/15/2006) or are you using a Date function (like Date.Today), or maybe a date control?


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day! Ye has a choice: talk like a pira
 
I use CStr(Now.ToShortTimeString())

thanks for your reply
 
You dont need the CStr function.. and futhermore, what does the Now.ToShortTimeString() has to do with the retrieved value from the database ??
 
TipGiver: I was just trying to determine if the OP was putting in an actual time, or a date only and getting a default 12:00 AM because no time was being input.


The next questions are:

What database are you using?
Do the data show up as the correct time in the database?
How are you retrieving the data?
How are you displaying the data?
Are you using any formatting on the retrieved data?

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day! Ye has a choice: talk like a pira
 
Sounds like the Date/Time in the database is only entered as a date, hence the default time value. (Yes, technically I know it's not default, since it's an integer/serial number there is in fact no time value.)

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a MS MVP? PODA
- Leonardo da Vinci
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top