I have a Harvest_Base class where all DateTime formats are displayed,
class Harvest_Base { public static DateTime storeTime(String date) { DateTime returnValue = new DateTime(); if (date == "") return returnValue; //Time or Date Component Does not Exist string[] formats= {"M/d/yyyy h:mm:ss tt", "M/d/yyyy h:mm tt", "MM/dd/yyyy hh:mm:ss", "M/d/yyyy h:mm:ss", "M/d/yyyy hh:mm tt", "M/d/yyyy hh tt", "M/d/yyyy h:mm", "M/d/yyyy h:mm", "MM/dd/yyyy hh:mm", "M/dd/yyyy hh:mm", "h:mm tt","hh:mm tt","HH:mm:ss","H:mm","HH:mm","h:mmtt"}; DateTime result; if (DateTime.TryParseExact(date, formats, System.Globalization.CultureInfo.InvariantCulture, DateTimeStyles.None, out result)) returnValue = result; else returnValue = DateTime.Today; return returnValue; } }
I have a view class in which I have two combo boxes for starting and stopping. I want to do something bu that these comboBoxes should show me values ββin the format "hh: mm tt".
My questions:
Is binding required here? If so, explain with the code in return.
If no binding is required, then what can I do to achieve this result?
source share