How to pass DateTime Timestamp to Sharepoint 2007

Hi Folks,

if you developing sharepoint application,you will face that the DateTime timestamp parameter on sharepoint is different than what you are used to pass in your .Net Application.

In SharePoint 2007,the TimeStamp has to passed as a string and this is the format of the string:

“YYYYMMDDTHHMMDDZ

Take these Notes:

1) Date Part is followed by T Symbol.
2) Time Part is followed by Z Symbol.

and the the rest of the string is easy to get it in your application by using:

C#:
DateTime.Now.Date.ToShortDateString()
DateTime.Now.Date.ToShortTimeString()

By using any string concatenation “+” or use String Builder Class to give better performance.


Hope this helps…………….


Regards,
Moustafa arafa

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>