Pages

Thursday 2 May 2019

SharePoint Rest api JSON Result return one day before date.


SharePoint Store the date& time Field as UTC format , when we retrive the datatime flied it will return as UTC format,

i use moment.JS to convert date & time , you can download from https://momentjs.com/

download the moment.js and add the reference Js or any file where your fetching this date.


<script type="text/javascript" src="/path to Jquery/jquery-1.12.2.min.js"></script>
<script type="text/javascript" src="/path to Momentjs//moment.js"></script>

var StartTime= (item.ProgramStartDate);
console.log("Date Before Conversion: " +StartTime );

 StartTime= moment(StartTime).format('DD-MM-YYYY');
console.log("Date Before Conversion: " + StartTime);

Result will be like below.

I use dd-mm-yyyy Format. there are many other formats are available in momentjs.



SharePoint Search Service error : Could not connect to the search administration Web service on server SPSWAPP01 because the web server is not running.

SharePoint Search is not working  .

Logged in to SharePoint server and open Central administration  -> Service applications -> Click on Search Service application :



You will notice there is an error : Could not connect to the search administration Web service on server SPSWAPP01  because the web server is not running.

Open command prompt as administration and run the below command.
net start spsearchhostcontroller

Restart the IIS and with cmd iisreset

open search service application from Console. and check the status.