Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ok, I may have spoken too soon. Even with this option the query is still sent to the DB with an automatic adjustment based on my regional settings... Oh SharePoint, how I hate thee sometimes.
Thanks for the reply and information. My biggest problem isn't getting things into or out of UTC. The problem is when I provide a UTC date to an SPQuery, it sends that date to the DB as the users local time instead of keeping it as UTC. Since I'm doing stuff that depends highly on date/time, this is causing results to be left off that should be included.
Just thought I'd come back an post an update on this. Just changing the page layout wasn't enough for me, I had to also set the ContentTypeId as @GavinB suggested. Here is a code snippet: page.Layout = newPageLayout;page.ListItem[SPBuiltInFieldId.ContentTypeId] = newPageLayout.AssociatedContentType.Id;page.Update();
Thanks for the reply. The point about security trimming is a good point. There will be security placed on some individual items. A lot of the data won't have security, but some will. I will be using the modification date to only pull new items for "partial updates". But when I need to pull the full view again I need to pull the most recent 20 (or more or less) items in. Some of those items will already be in cache, so I don't need to fetch the full dataset for them from the db, I just need their ids to check against cache. Then for items not in cache, I need to go back for the full dataset.