- How to get last modified date of a sharepoint group.
- how to get date when a user is added to a sharepoint group.
thanks for your help.
Arvind
thanks for your help.
Arvind
您可以通过以下代码获取“创建”和“上次修改”日期:
SPList groupInformationList = SPContext.Current.Web.SiteUserInfoList;
SPListItem grpItem = groupInformationList.Items.GetItemById(group.ID); // Pass the ID of group
// OR, SPListItem grpItem = web.SiteUserInfoList.GetItemById(web.SiteGroups["group_name"].ID);
string groupCreationDate = Convert.ToDateTime(grpItem[SPBuiltInFieldId.Created]).ToString("MM/dd/yyyy hh:mm tt"); //Group Creation Date
string groupLastModifiedDate = Convert.ToDateTime(grpItem[SPBuiltInFieldId.Modified]).ToString("MM/dd/yyyy hh:mm tt"); // Group Modification Date
我不知道有一种开箱即用的方法来做到这一点。SPGroup和SPUserCollection类不包含日期。即使查看内容数据库(不受支持),Groups 或 GroupMembership 表也没有日期。