Saving date into db

Results 1 to 3 of 3

Thread: Saving date into db

  1. #1
    Join Date
    Dec 1969

    Default Saving date into db

    I&#039m currently using an access db, and I want to save some dates into it. My problem is that asp (access) formats the date different depending on what the regional settings are set to be. This is _not_ a problem when getting the date from the database, since I then know how to get the different parts of the date, but how can I assure myself that the date I&#039m saving is always correct according to the regional settings at the server.<BR>The form that the date is retrieved from, has three fields (year, month, day).

  2. #2
    jason Guest

    Default RE: Saving date into db

    you can set the session.localeID in the asp page to reflect the settings used in the database (or the other way round) - depends exactly what format you need to store and waht format you need to display<BR><BR>jason

  3. #3
    Join Date
    Dec 1969

    Default RE: Saving date into db

    If you have three seperate fields on the form, what&#039s the problem?<BR><BR>sMonth = Request.Form("tMonth")<BR>sDay = Request.Form("tDay")<BR>sYear = Request.Form("tYear")<BR>sDate = sMonth & "/" & sDay & "/" & sYear<BR>&#039-or-<BR>sDate = sYear & "/" & sMonth & "/" & sDay <BR><BR>If you want to make sure the user enters valid values, you&#039ll need some sort of validation code on the client(jScript). You could validate with ASP, but that would require a trip to the server.<BR><BR>HTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts