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
janine valenzona
NA
17
0
calculating time duration
Apr 3 2010 8:57 AM
hi.. please check this code of mine:
protected void Button4_Click(object sender, EventArgs e)
{
DateTime dt1;
DateTime dt2;
string currenttime1 = DateTime.Now.ToLongTimeString();
string currenttime2 = DateTime.Now.ToLongTimeString();
TextBox2.Text = currenttime2;
dt1 = Convert.ToDateTime(currenttime1);
dt2 = Convert.ToDateTime(currenttime2);
TimeSpan ts = dt1 - dt2;
int hours = ts.Hours;
int min = ts.Minutes;
string finalMin = Convert.ToString(min);
TextBox3.Text = finalMin;
---- i'm having a web page that calculated time duration when the user press the stop button.. but the output of this code is always zero.. what is my error?
thanks in advance.. :)
--im using asp.net and C#
Reply
Answers (
5
)
sap.net with c# and sqlserver
How Insert into SQL Server2000 DataBase to Image Data by VB.Net