0

We have a csom list item operation, where we get one, and with item["Created"] we get the date and time of creation for the list item.

However the problem is that its always returning the UTC time, we are in GMT -5.

I have tried Convert.ToDateTime(item["Created"]).ToLocalTime(), and a few others but I havent been able to convert it to the local time, it alwas returns my time +5 hours.

Any idea how to fix this?

1

you should add time zone offset

TimeZoneInfo.Local.GetUtcOffset(DateTime.UtcNow);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.