locked
Sharepoint list in LS: DateTime column returning local time in LS RRS feed

  • Question

  • I have a SharePoint site which is set to US Central time.

    I have one of the SharePoint lists as a datasource in LS2012.4

    The Created/Modified datetimes of each list item appear in US Central time, both on the SharePoint list, and when the item is displayed on a screen in LightSwitch.

    I was under the impression that SharePoint dealt in UTC, and it was the Regional Settings in the SharePoint which decided how the date appeared to the user on the SharePoint site... if that was the case, I would be getting the dates in LS in UTC time (and I could then display this time to users in their own local time format).  But that doesn't seem to be the case.

    Does anyone know how to get UTC datetimes from SharePoint into LS (without doing a manual conversion in LS)?  I tried creating a new hidden calculated column in SharePoint with the date I want converted to UTC, but I don't think there are any timezone functions in SP for calculated fields.


    Free Visual Studio LightSwitch extensions: Elyl's Extensions

    Friday, January 31, 2014 3:14 PM

All replies

  • HI Elyl

    According to your description above, you want to get UTC datetimes from SharePoint into LightSwitch, what about using DateTime.ToLocalTime()? please take a look at converting UTC DateTime for display.

    hope it helps.

    Angie Xu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Sunday, February 9, 2014 8:41 AM
  • No, I'm saying that the date I get from the SharePoint datasource is in neither local time, nor in UTC.  It's in US Central time.

    I would like to get this date in UTC (or local time), but can see no way how without doing a manual timezone conversion each time the date is used.

    Shouldn't SharePoint be giving this datetime to LightSwitch in UTC format in the first place?


    Free Visual Studio LightSwitch extensions: Elyl's Extensions

    Sunday, February 9, 2014 4:42 PM