I would like to know how to store time in C# and PostgreSQL
Ex:
var startTime = 8.00;
var endTime = 9.20;
var total = endTime - startTime ;
toatl is 80min
And then store this value in a database.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In C# you can use
DateTimeand in PostgreSQL you can use theTIMESTAMPtype.EDIT
If you only need to store time, and not date, then you can use the
TIMEtype.See also http://www.postgresql.org/docs/8.2/static/datatype-datetime.html.