siva nathan

siva nathan

  • 945
  • 828
  • 231.4k

How to insert time only from datetime in C# and sql

Mar 23 2017 9:49 AM
i have a grid like below i want to insert a time only from a datetime
 intime outtime
 01-01-2017 08:45:12 01-01-2017 20:00:12
 01-02-2017 08:45:12 01-02-2017 18:45:12
my expected result is i want to store only time in sql column
  08:45:12 20:00:12
  08:45:12 18:45:12
pls explain in both C# and sql
what kind of datatype i have to use to store time only in sql column 

Answers (7)