www.webdeveloper.com
Results 1 to 4 of 4

Thread: dates

  1. #1
    Join Date
    May 2005
    Posts
    49

    dates

    i have a simple form that adds simple text fields to a db to be viewed on another page.

    but my question: whats the best way to go around getting getting the date?

    i was thinking of having a javascript that puts it into a hidden form field and just adds it in the db. but would that need to be in date/time record or a notmal text record. but that would give differnt times if ppl are in differnt time zones would it?

    so how can you use asp to get the server date and time? and whats the best way to put this in the db

    im using an access db

    regards

  2. #2
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    The following will return the current date according to the server.
    Code:
    Date
    Yep, its that simple.

    MS Access stores dates as a number in the background but will automatically format the entered date for you. So, use a date/time field in your database.

    Use an SQL query to insert the data.
    Code:
    INSERT INTO tableName (yourDateField) VALUES ('" & Date & "');"
    Regards.

  3. #3
    Join Date
    May 2005
    Posts
    49
    wow! cheers

  4. #4
    Join Date
    Jun 2005
    Location
    WI, US
    Posts
    188
    you could also just add a timestamp field to your database so anytime a record is added to it the database puts the timestamp in

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles