how many times can you spot the letter "t" in:
q: updating a list item using date() function i have a column [scheduletime] which is a datetime type in my list. using javascript i need to update the [scheduletime] column which should be current day whenever my script loads. but here i need to update [scheduletime] column's date only. time should remain same. i am gonna use set_item function.
please help me out on this.
var colllistitem;


executeordelayuntilscriptloaded(retrievelistitems, "sp.js");

 function retrievelistitems() {


sucess();


var clientcontext = new sp.clientcontext(siteurl);

var olist = clientcontext.get_web().get_lists().getbytitle('master task summary');





var camlquery = new sp.camlquery();

camlquery.set_viewxml("<view><query><where><geq><fieldref name='scheduletime'/><value includetimevalue='true' type='datetime'><today /></value></geq></where></query><rowlimit>10</rowlimit></view>");


this.colllistitem = olist.getitems(camlquery);

clientcontext.load(colllistitem);

clientcontext.executequeryasync(function.createdelegate(this, this.onquerysucceeded), function.createdelegate(this, this.onqueryfailed));        

}

function sucess()
{ 

   var clientcontext1 = new sp.clientcontext(siteurl);

    var olist1 = clientcontext1.get_web().get_lists().getbytitle('master task summary');

var varlist= olist1.getitembyid(86);

alert("1st");

   var scheduletime = new date(varlist["scheduletime"]);

alert("2st");

var today = new date();

var newscheduledtime = new date(today.getfullyear(), today.getmonth(), today.getdate(), scheduletime.gethours(), scheduletime.getminutes(), scheduletime.getseconds(), scheduletime.getmilliseconds());

 alert("3st");
 varlist.set_item('scheduletime', newscheduledtime);
alert("4th");
 varlist.update();
alert("5th");

  clientcontext1.executequeryasync(function.createdelegate(this, this.onquerysucceed), function.createdelegate(this, this.onqueryfailed)); 

  }

function onquerysucceed()
{
alert("update usccess");
}


a: you can make use of javascript date object for that.
for example, while reading the data 
var scheduledtime = new date(olistitem["scheduledtime"]);

now you can calculate the new time as follows
var today = new date();
var newscheduledtime = new date(today.getyear(), today.getmonth(), today.getdate(), scheduledtime.gethours(), scheduledtime.getminutes(), scheduledtime.getseconds(), scheduledtime.getmilliseconds());

now while saving use newscheduledtime
olistitem.set_item('scheduledtime', newscheduledtime);
olistitem.update();
clientcontext.executequeryasync(function.createdelegate(this, this.onquerysucceeded), function.createdelegate(this, this.onqueryfailed));

update based on edit
executeordelayuntilscriptloaded(retrievelistitems, "sp.js");
var item;
var clientcontext;
var olist;
function retrievelistitems() {
    clientcontext = new sp.clientcontext(siteurl);
    olist = clientcontext.get_web().get_lists().getbytitle('master task summary');
    item= olist.getitembyid(86);
    clientcontext.load(item,"include('scheduletime')");
    clientcontext.executequeryasync(function.createdelegate(this, onquerysucceeded), function.createdelegate(this, onqueryfailed));
}

function onquerysucceed() { 
    alert("item retrieved"); 
    var scheduletime = new date(item.get_item('scheduletime'));
    alert(scheduletime);
    var today = new date();
    var newscheduledtime = new date(today.getfullyear(), today.getmonth(), today.getdate(), scheduletime.gethours(), scheduletime.getminutes(), scheduletime.getseconds(), scheduletime.getmilliseconds());
    alert(newscheduledtime);
    item.set_item('scheduletime', newscheduledtime);
    item.update();
    clientcontext.executequeryasync(function.createdelegate(this, onupdatesucceeded), function.createdelegate(this, onqueryfailed));
}

function onupdatesucceeded() {
    alert('updated');
}

function onqueryfailed(sender, args) {
    alert('request failed. \nerror: ' + args.get_message() + '\nstacktrace: ' + args.get_stacktrace());
}


user
There are three hundred and sixty-two "t"s in the text you provided.
assistant