Click to See Complete Forum and Search --> : dates


benbramz
06-21-2005, 05:46 PM
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

buntine
06-21-2005, 06:25 PM
The following will return the current date according to the server.

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.

INSERT INTO tableName (yourDateField) VALUES ('" & Date & "');"

Regards.

benbramz
06-23-2005, 03:22 PM
:eek: wow! cheers

silverbullet24
06-23-2005, 05:22 PM
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