How to pass DateTime Timestamp to Sharepoint 2007

No.of Views1042
Bookmarked0 times
Downloads 
Votes0
By  Mostafa Elzoghbi   On  16 Jun 2010 09:06:20
Tag : SharePoint , Development and Programming
How to pass DateTime Timestamp to Sharepoint 2007
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

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();

 VB.NET

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.

 
Sign Up to vote for this article
 
About Author
 
Mostafa Elzoghbi
Occupation-
Company-
Member Type-Junior
Location-United States
Joined date-07 Jun 2010
Home Page-http://moustafa-arafa.blogspot.com
Blog Page-http://moustafa-arafa.blogspot.com
MCSD,MCT,MCTS,C# MVP
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top