JavaScript Question

Results 1 to 2 of 2

Thread: JavaScript Question

  1. #1
    Join Date
    Dec 1969

    Default JavaScript Question

    I am using this function to return the current time to my form<BR><BR>&#060;/script&#062;<BR><BR>&#060;script&#062;<BR>&#060;!-- begin code<BR>function showtime2 () {<BR>var now = new Date();<BR>document.form1.start.value = now;<BR><BR>}<BR>// end code --&#062;<BR><BR>&#060;/script&#062;<BR><BR>It displays the information like this<BR><BR>Thu Sep 26 14:11:10 EDT 2002<BR><BR>Which is fine but i would like the time to not be in military time. Does anyone have any suggestions on how I should do this. <BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: JavaScript Question

    function showtime2 () {<BR>var now = new Date();<BR>document.form1.start.value = (now &#062; 12)? now : now - 12;<BR>}<BR><BR><BR><BR>I can&#039;t remember right now how dates work in JS... play around a bit.<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