0

I've been searching around the net but I only see integer to date. How can I convert a chosen date in radDatePicker to integer? I have tried Convert.ToInt32 but I get an error at runtime

2 Answers2

0

You can try this code

  DateTime dt =Convert.ToDateTime(RadDatePicker1.SelectedDate);
  string  temp = dt.ToShortDateString();

  int value;
  int.TryParse(temp, out value);
mck
  • 978
  • 3
  • 14
  • 38
0

Try this:

DateTime.Now.Ticks

For normal datetime object it works. Means if you could get DateTime value from radDatePicker you may apply .Ticks property to it.

Khadim Ali
  • 2,548
  • 3
  • 33
  • 61