Tag Info

New answers tagged


Once you have retrieved the value form the Date field using JS, use the method "localeFormat()" to convert it to the local time zone and format as desired. Below are a few examples. console.log(targetListItem.get_item('Created').localeFormat()); console.log(targetListItem.get_item('Created').localeFormat("dd/MM/yyyy HH:mm:ss"));


var serverOffsetTime = ""; function serverDefaultDateTime() { var clientContext = new SP.ClientContext.get_current(); this.timeZone = clientContext.get_web().get_regionalSettings().get_timeZone(); clientContext.load(timeZone); clientContext.executeQueryAsync(Function.createDelegate(this, this.onGetServerOffsetTimeSuccess), ...


javascripts Date will give you the local time on the client. var now = new Date();


this is how i solved it. It may be useful to someone in the future. function ConverTimeZoneOnEventsList(){ var url = window.location.href; debugger; if (url.indexOf('Lists/Events/DispForm.aspx') >= 0) { var dateElements = document.getElementsByName('SPFieldDateTime'); for (var i = 0; i < dateElements.length; i++) { var temp = ...

Top 50 recent answers are included