CustomCodes‎ > ‎

DateTime format acceptable to CAML query

//Define a DateTime variable
DateTime strCurrentDateTime = DateTime.Now;
 
// Converting current DateTime format acceptable for CAML query.
string strCustomDateTime = SPUtility.CreateISO8601DateTimeFromSystemDateTime(strCurrentDateTime);
Comments