I have a text input form box that has a date time javascript snippet in it to forward date and time of registration when customer hits submit button. When the date time shows up in the database it sometimes is spelled out (Monday March 23, 2013 3:15 pm) and sometimes is only numbers (3/23/2013 3:15 pm). I would be grateful for help to make the script always show the numbers only (3/23/2013 3:15 pm) and not the spelled out version. How do you apply a css to the javascript to change the font size and color? The code is below. Thank you.



<INPUT name="date_and_time" class="date_and_time"
type="text">




<SCRIPT type="text/javascript">
//<![CDATA[

function setClock() {
var today=new Date();
var clock=today.toLocaleString();
var date_and_time = document.querySelector('.date_and_time');
date_and_time.value = "" + clock;
// document.forms[0][0].value ="Today is " + clock;

setTimeout("setClock()");
}

onload= setClock;

//]]>
</SCRIPT>