I would like to set the current date/time to populate automatically into the input textbox according to the same format used by this timepicker plugin:
http://trentrichardson.com/examples/timepicker/
The plugin assumes that you want the input text field to appear blank until the user interacts with it.
$('#example2').datetimepicker({
ampm: true
});
But I want the input text field to already contain the current date and time:
05/16/2011 04:00 am
The only way I can see to do this at the moment is using my server-side scripting language.
But ideally there should be a way to do this with JavaScript or jQuery?
In the link you provided, it shows you how to specify the time:
A quick way would be to set the value of the text box within the HTML markup, e.g.
Or it could be done with JQuery: