TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
SIVA
NA
742
707.4k
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
Reply
Answers (
2
)
Best way to display on growing text log files in ASP.Net Web page
Web.config files