Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

Setting a list Date field to it's date + 7 days using C#

$
0
0

I have a SharePoint list field called ArchiveDate.

In a C# function I'm looping through the list and have the item in question.

foreach (SPListItem fListItem in fList.Items)      
{       
   
foreach (SPField field in fList.Fields)       
   
{    

If fListItem[field.Id] has that column item with a date in it. How can I add 7 days to that date using C#?

i know I can set the value of the field to today as follows:

         DateTime dt = DateTime.Now;  
         tListItem
["Archive Date"] = dt; 
         tListItem
.Update();    

============================
Thank You
cyberpine.com


Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>