Trying to pass the datetime (in the input) through the JS to the apex
controller - This one is working now
I would suggest provide some more information about what have you done with the first requirement what kind of JS action invocation you did.
Update: (thanks to @sfdcfox for mentioning it Lightning Enabled tag question)
If you are looking that thing in Lightning perspective then I'm assuming you used @AuroEnabled Client-server enabled menthod to pass the Date into apex controller, Now use
action.setCallback() to invoke another method and pass your parameters from JS directly via
see below reference on more info:
see more info on action.setCallback():
Use of setCallBack() in Lightning
Using Visualforce (Conventional Way):
There are various ways to invoke any second method/action on completion of other, it depends on your first action invocation type. If you want to use JS for calling action then use
<apex:actionFunction>, it supports rerender attribute which will helps you to rerender the result on the page side.
if you used
<apex:actionFunction> as your first invocation, then you can use onCompletion attribute of these action methods, and in that oncompletion you can call any other
<apex:actionFunction> which eventually calls your controller action.
see more on