.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sharon Maxwell

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Sqlserver time

Posted By: Naresh     Posted Date: August 19, 2010    Points:2   Category :ASP.Net
Hi All,

If i give databse columns value as (12:00-19:00) i.e time,can we able to get start time,endtime and difference in FRONTEND AND also in backend.Here 12:00 is the starttime and 19:00 is the endtime.Tell me how we can acheive this in front end and also in backend.

Author: Syed Shakeer Hussain             
Posted Date: August 19, 2010     Points: 5   

The Below code is to find the Difference between two Times

DateTime StartTime = DateTime.Now.ToLocalTime();

DateTime EndTime = DateTime.Now.ToLocalTime();

string dt = EndTime.Subtract(StartTime).ToString().Split('.')[0].ToString();

button1.Text = dt;


StartTime:8/7/2010 3:31:16 PM

EndTime:8/7/2010 3:32:07 PM


Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend