By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,336 Members | 2,307 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,336 IT Pros & Developers. It's quick & easy.

Saving times

P: n/a
I'm trying to save a time (08:01 for example) to a Data/Time field
(formatted Short Time) in an Access table using VB.NET. The problem is
that even when I write this time to a dataset, it winds up saving as
#08/28/2003 08:01 AM# in the database, where the date is today's date. In
plain ol' VB6, I am able to write 08:01 to the database with no date. Is
there any way to write the time only in VB.NET?
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
you just need to format the DateTime when you convert it to a string.

See
http://msdn.microsoft.com/library/en...ringTopic1.asp

probably you want something like

System.DateTime.Now.ToString("t")

"Chris Huddle" <ch*****@timeplus.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I'm trying to save a time (08:01 for example) to a Data/Time field
(formatted Short Time) in an Access table using VB.NET. The problem is
that even when I write this time to a dataset, it winds up saving as
#08/28/2003 08:01 AM# in the database, where the date is today's date. In
plain ol' VB6, I am able to write 08:01 to the database with no date. Is
there any way to write the time only in VB.NET?

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.