Convert DateTime to Double
c#, charts, datetime, visual-studio, zooming
Solution
You can use `DateTime.ToOADate()`, if you mean ole automation date by double
Problem
I've created a DateTime value from an item being clicked in a listBox. It's in the format `dd/MM/yyyy hh:mm:ss`. I'm want to zoom in on a ten minute period with the clicked event in the middle. My current code is as follows (where zoom_time is the DateTime to zoom to on my chart; ``` chart1.ChartAreas[0].AxisX.Minimum = (Convert.ToDouble(zoom_time.AddMinutes(-5))); chart1.ChartAreas[0].AxisX.Maximum = (Convert.ToDouble(zoom_time.AddMinutes(5))); ``` This breaks saying "invalid cast from DateTime to double" Any ideas guys?