SIVA

SIVA

  • NA
  • 742
  • 699.8k

Comparison between two values

Apr 11 2012 11:50 AM
Dear all,

I have variable ie. oDateTime with the type of datetime & i extracted time from it as follows,

string.Format("{0:t}", oDateTime); 
now my output is 4:00AM
My dropdownlist controls having the values like 01,02.....12 for Hours nd 01,02...59 for Minutes & AM,PM for FormatDropdown control.
Now here on button click event it will retrieve the values & will show those values in controls as selected value as follows..
ddlTFHrs.SelectedValue = String.Format("{0:hh}", oDateTime);
ddlTFMin.SelectedValue = String.Format("{0:mm}", oDateTime);
ddlTFAMPM.SelectedValue = String.Format("{0:tt}", oDateTime);
Here I am getting error when i try to compare 04 with 4
Can i format time in string format as 04 or else is there
any alternate way to compare these two values.
Thanks



Answers (2)