[thelist] ASP: Getting client's time and date

Anthony Baratta Anthony at Baratta.com
Thu Jul 27 16:44:58 CDT 2000


Michael Galvin wrote:
> 
> So is there any way of getting the client browser's time and date?  I could
> use the javascript client-side script to determine it, but I have no idea
> how to integrate JS and ASP.  Can variables initialised and set within JS be
> used outside (it needs to be written to an Access database).  My ASP script
> is VBscript, in case that makes any sort of difference.

Why not do this....

Add this to your header:

<script>
function SetDateTime() {
	document.myForm.DateTime.value = new Date();
	// Change myForm to the name of your Form
}
</script>

In the form tag add:

	onSubmit="SetDateTime()"


In your form add:

	<input type="hidden" name="DateTime" value="">

Therefore when the form is submitted, you get the Date time stamp from the browser
loaded into the hidden form field called DateTime.

Should work.
-- 
Anthony Baratta
President
KeyBoard Jockeys
                    South Park Speaks Version 3 is here!!!
                       http://www.baratta.com/southpark
                              Powered by Tsunami




More information about the thelist mailing list