sábado, 3 de marzo de 2012

Formato ISO8601 y Sharepoint 2010

Sharepoint 2007 y 2010 internamente trabaja con fecha en el formato ISO8601

yyyy-mm-ddThh:mm:ssZ


Convertir desde DateTime a ISO8601 DateTime (C#):

DateTime date = DateTime.Now;
string isoDate = SPUtility.CreateISO8601DateTimeFromSystemDateTime(date);

OR

DateTime.Now.AddDays(15).ToString("yyyy-MM-ddThh:mm:ssZ");


Example:




Convertir desde ISO8601 a DateTime (C#):

DateTime date = DateTime.Parse("2010-06-15 00:00:00");
string sysDate = date.ToString("MM/dd/yyyy");


 

Fuente:


http://prasanjitmandal.blogspot.com/2010/06/sharepoint-datetime-format-conversions.html


http://blog.furuknap.net/convert-datetime-to-iso8601-for-use-in-sharepoint-caml-queries


http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.sputility.createiso8601datetimefromsystemdatetime.aspx


http://www.dev4side.com/community/blog/2010/3/3/date-format-using-sharepoint-lists-web-service-and-updatelistitems-method.aspx

No hay comentarios:

Publicar un comentario