5

I want to store the office starting time etc in my database.

The time I want to store is like 09:15 AM or 1:15PM etc

My question is what is the best way to store it?

For the time being I am using int in SQL Server.

And I am storing the data like 0915, 1605, 2305 (maybe I can use some sort of constraints too)

Is there any better and good way to do it.

Any help is appreciated.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Moons
  • 3,833
  • 4
  • 49
  • 82

1 Answers1

9

If you are using SQL 2008 or newer, you can use TIME Datatype to store only time.

Himanshu
  • 31,810
  • 31
  • 111
  • 133