How to convert time into "To Time Format" of Time Log

Hi Everyone,

Can anybody tell me what is the way to convert the current time into the “End Time Format” as shown below:

Here is my code:

var curr_date=new Date();
var vend_date=new Date();
vend_date=frm.doc.to_time;

msgprint("Current Time");
msgprint(curr_date);
msgprint("End Time");
msgprint(vend_date);

instead of converting Date to format you can use dateutil. It will return the date time in “YYYY-MM-DD HH:mm:ss” format .

var curr_date = dateutil.now_datetime()
var vend_date = dateutil.now_datetime()

Thanks,
Makarand