Getting and Writing Current Date in AsP (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


futurewebboss -> Getting and Writing Current Date in AsP (3/6/2008 15:00:44)

I have an html form that takes first name and last name and is then submitted to an asp page to write the data to an access db. What I need to do is to time stamp the entry. Can anyone suggest the best way to do this?
For example,
Can I pass the current date in a hidden form field at the time the user enter his first and last name, or should I get and then write the date in the asp page?




ou812 -> RE: Getting and Writing Current Date in AsP (3/6/2008 15:57:14)

Personally, I like writing the date to the database at the time of the actual writing. Depending on where your server's timezone is may depend on how you want to do it

I use now() for the current date/time and then use dateadd if needed to manipulate the time to account for timezones

objRS.Fields("TimeStamp") = dateadd("H",-3,now())
or
objRS.Fields("TimeStamp") = now()




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
9.179688E-02