none
DateTime in MS Access RRS feed

  • Question

  • Hello- Can someone please help me?

     

    I am developing a website using VS 2003, ASP.NET (VB), MS Access 2002 (MS Access 2000 format). In my codebehind, I retrieve the UTCDate with:

     

    TimeZone.CurrentTimeZone.ToUniversalTime(Now)

     

    or with

     

    Date.UtcNow

     

    Either way, it displays correctly (08/15/2007 11:23:32 AM) in a label control on the webform. But I cannot make it store the information correctly in the database field. It always stores 12:00:00 AM for the time.

     

    Thanks in advance,

    Gerry

    Wednesday, August 15, 2007 8:51 PM

Answers

  • In a new record, I use:

     

    AnyRow("UTCDate") = Date.UtcNow

     

    When updating an existing record I use

     

    .UTCDate = Date.UtcNow

     

    The database field UTCDate is defined as DateTime.
    Wednesday, August 15, 2007 9:04 PM

All replies

  • How is it being inserted into the database?

    Wednesday, August 15, 2007 8:56 PM
  • In a new record, I use:

     

    AnyRow("UTCDate") = Date.UtcNow

     

    When updating an existing record I use

     

    .UTCDate = Date.UtcNow

     

    The database field UTCDate is defined as DateTime.
    Wednesday, August 15, 2007 9:04 PM