开发者

sharepoint dateandtime field get hours

I am trying to get hours from the DateandTime field of a sharepoint calendar listitem using sharepoint Object Model.

int starttime = Convert.ToInt32(item["Start Time"]);

Obviously which returns type error.

Please throw some light that how i can pick Time value from the field and convert to 开发者_Python百科Int.

Thanks in advance.


Try:

DateTime starttime = Convert.ToDateTime(item["Start Time"]);

From there, you have a number of time properties (Hour, Millisecond, Minute, Second) that are integers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜