Saving times

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Huddle

    #1

    Saving times

    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?


  • Dino Chiesa [MSFT]

    #2
    Re: Saving times

    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" <chuddle@timepl us.com> wrote in message
    news:%234Zaobbb DHA.2548@TK2MSF TNGP09.phx.gbl. ..[color=blue]
    > 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?
    >
    >[/color]


    Comment

    Working...