开发者

Creating DateTime object from DatePicker and TimePicker control

开发者 https://www.devze.com 2023-04-08 06:25 出处:网络
How to create DateTime object from DatePicker and TimePicker controls in Windows Phone 7? DateTime object constructor accepts only int with yea开发者_开发知识库rs, months etc. Is there a smart way t

How to create DateTime object from DatePicker and TimePicker controls in Windows Phone 7?

DateTime object constructor accepts only int with yea开发者_开发知识库rs, months etc. Is there a smart way to combine date and time and assign it to DateTime ?


use

DateTime MyDateTime = ((DateTime) MyDatePicker.Value).Date.Add (((DateTime)MyTimePicker.Value).TimeOfDay);
0

精彩评论

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