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


Top 5 Contributors of the Month
david stephan

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

Datatypes for TimeIn and timeout

Posted By: Naresh     Posted Date: September 28, 2010    Points:2   Category :ASP.Net
Hi All,

What datatype i should use for TimeIn and TimeOut of the employee in database and also in front end.

I have value like 17:00,2:00.what datatype i should to store this value.


Responses
Author: Deco             
Posted Date: September 28, 2010     Points: 5   

Naresh,

You can store the full date and time

bacause if you want to read the intime and out time for an employee for a particular date.

it will be really helpful

while extracting the time

you can use
SELECT CONVERT(VARCHAR, GETDATE(), 108)


Regards,
Deco
Author: Asha.MP             
Posted Date: September 28, 2010     Points: 5   

Hi..

In front end you can take the datetime.now, from that you can extract whatever you want like
time, date, month, year.

you can use
datetime dt=datetime.now
Console.WriteLine("Date with t option:{0}", dt.ToString("t"))


In data base you can use same thing which has given by Mr.Alwyn.

Thanks and Regards,
Asha.mp
Author: Santosh             
Posted Date: October 04, 2010     Points: 5   

hi Naresh

use datetime datatype for sroring timein and timeout of a employlee.

and in frond end u can format the stored datetime and u can get only time..


regards
santosh





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
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

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