How to store Clien side date & time to database...

Results 1 to 2 of 2

Thread: How to store Clien side date & time to database...

  1. #1
    Join Date
    Dec 1969

    Default How to store Clien side date & time to database...

    Hi dears, <BR> How can i store client side time and date to my Database.<BR> Using javascript.......?Or it can be done using ASP.I was trying to assign client side time to a session level variable...but it does&#039;t works....<BR>What should i do.<BR>thanks

  2. #2
    Join Date
    Dec 1969

    Default Send it from the client...

    That&#039;s the cleanest way.<BR><BR>Just have a hidden form field:<BR><BR>&#060;INPUT Type=Hidden Name="clientDateTime"&#062;<BR><BR>And fill it in either at onSubmit time for the &#060;FORM&#062; or maybe at onLoad for the &#060;BODY&#062;.<BR><BR>&#060;BODY onLoad="document.FormName.clientDateTime.value=(ne w Date()).toString();"&#062;<BR><BR>The string will be in JS format, so you&#039;ll need to do a little manipulation in your ASP code to read it and decipher it. (The alternative is to use JS code to format it into VBScript style. Whichever. It&#039;s about the same amount of work on either side.)<BR><BR>Anyway, now when the form gets submitted, the date/time rides right along with it.<BR><BR>

Posting Permissions

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