Print Page | Close Window

Date and Timestamp

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=4034
Printed Date: 29 March 2026 at 11:56pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Date and Timestamp
Posted By: resultswithstyl
Subject: Date and Timestamp
Date Posted: 03 July 2003 at 9:04am

Has anyone ever done a time stamp on a web site. For example when a job is closed (option within a drop down menu) I want it display the date and time of when the job was closed in the record and displayed on the page. Thanks in adavance for any help.




Replies:
Posted By: pmormr
Date Posted: 03 July 2003 at 9:32am

If jobclosed then
   rs.fields("closed") = now()
End if

response.write("Job closed on " & rs.fields("closed"))



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: resultswithstyl
Date Posted: 03 July 2003 at 9:46am

How come it doesn't add it to the field in the database and why does it always display the current time upon refresh. Thanks for the help.

This is the code I am using on the page now slightly modified.

If RS("spec_call_status") = "Closed" then
         RS("spec_closed_time") = now()
End if



Posted By: pmormr
Date Posted: 03 July 2003 at 9:55am

Alright, i'll take the time to write an entire script. You need to have a variable set to the job ID called "jobidn"

Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.provider = "Microsoft.Jet.OLEDB.4.0"
conn.open "put your database path here!!!"

'I'm going to update the current record...
strSQL = "UPDATE yourtablename SET isjobclosed='yes', timejobclosed ='" & now() & "' WHERE jobid = '"& jobidn "';"

conn.execute (strSQL)

conn.close
Set conn = NOTHING

Anything in italics might need to be changed



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net