Skip to main content
added 94 characters in body
Source Link
Arsalan Adam Khatri
  • 14.5k
  • 3
  • 37
  • 59

I am trying to get the time value from the a DateTime field in SharePoint 2013 online.

When I try to retrieve the value of the field, it is showing only my browser time value. I am using the following code,

var ListItem;

function GetValue(){

var SPContext = new SP.ClientContext(siteUrl);

var list= SPContext.get_web().get_lists().getByTitle(listName);

ListItem = list.getItemById(12345);

SPContext.load(ListItem);

SPContext.executeQueryAsync(GetListItemById_Success, GetListItemById_Fail); }

function GetListItemById_Success() {

var dateTimeValue = ListItem.get_item("DateTimeColumnName");

alert(dateTimeValue);

}

var ListItem;

function GetValue(){

   var SPContext = new SP.ClientContext(siteUrl);

   var list= SPContext.get_web().get_lists().getByTitle(listName);

   ListItem = list.getItemById(12345);

   SPContext.load(ListItem); 

   SPContext.executeQueryAsync(GetListItemById_Success, GetListItemById_Fail);
}

function GetListItemById_Success()
{

   var dateTimeValue = ListItem.get_item("DateTimeColumnName");

   alert(dateTimeValue);


}

Let me know how to get the stored DateTime Value. I'm unable to set the property set_datesInUtc(false).

I am trying to get the time value from the a DateTime field in SharePoint 2013 online.

When I try to retrieve the value of the field, it is showing only my browser time value. I am using the following code,

var ListItem;

function GetValue(){

var SPContext = new SP.ClientContext(siteUrl);

var list= SPContext.get_web().get_lists().getByTitle(listName);

ListItem = list.getItemById(12345);

SPContext.load(ListItem);

SPContext.executeQueryAsync(GetListItemById_Success, GetListItemById_Fail); }

function GetListItemById_Success() {

var dateTimeValue = ListItem.get_item("DateTimeColumnName");

alert(dateTimeValue);

}

Let me know how to get the stored DateTime Value. I'm unable to set the property set_datesInUtc(false).

I am trying to get the time value from the a DateTime field in SharePoint 2013 online.

When I try to retrieve the value of the field, it is showing only my browser time value. I am using the following code,

var ListItem;

function GetValue(){

   var SPContext = new SP.ClientContext(siteUrl);

   var list= SPContext.get_web().get_lists().getByTitle(listName);

   ListItem = list.getItemById(12345);

   SPContext.load(ListItem); 

   SPContext.executeQueryAsync(GetListItemById_Success, GetListItemById_Fail);
}

function GetListItemById_Success()
{

   var dateTimeValue = ListItem.get_item("DateTimeColumnName");

   alert(dateTimeValue);


}

Let me know how to get the stored DateTime Value. I'm unable to set the property set_datesInUtc(false).

Source Link
Selva
  • 51
  • 3
  • 9

SharePoint Get Time from DateTime Column field

I am trying to get the time value from the a DateTime field in SharePoint 2013 online.

When I try to retrieve the value of the field, it is showing only my browser time value. I am using the following code,

var ListItem;

function GetValue(){

var SPContext = new SP.ClientContext(siteUrl);

var list= SPContext.get_web().get_lists().getByTitle(listName);

ListItem = list.getItemById(12345);

SPContext.load(ListItem);

SPContext.executeQueryAsync(GetListItemById_Success, GetListItemById_Fail); }

function GetListItemById_Success() {

var dateTimeValue = ListItem.get_item("DateTimeColumnName");

alert(dateTimeValue);

}

Let me know how to get the stored DateTime Value. I'm unable to set the property set_datesInUtc(false).