xaml - Get date from DatePicker using c# in windows store app -


i want insert date value in database have class have date time attribute

public datetime bookingdate { get; set; } 

i have date picker in xaml page named datepicker . want insert date value , how date using c#??

you can use date property , follow documentation

  datetimeoffset sourcetime = yourdatepicker.date;   bookingdate = sourcetime.datetime; 

to convert offset , bind datetimepicker

   datetime newbookingdate;    newbookingdate = datetime.specifykind(bookingdate, datetimekind.utc);    datetimeoffset bindtime = newbookingdate;    yourdatepicker.date = bindtime; 

adding datepicker (xaml)


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -