dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: what data type should i use for elapsed time, or a time amount??

  1. #1
    Join Date
    Mar 2010
    Posts
    281

    what data type should i use for elapsed time, or a time amount??

    Hi Everyone,
    I'm building a time-clock type application and am wondering about what data types to use.
    i'm wondering what data type to use for elapsed time, which is purely an amount of time

    i.e., hours:mins:seconds:

    for example: clock in at 3:15, clock out at 7:30, time elapsed is ....?

    should the datatype should that be? ...datetime?, if not what then...?


    thanks for any help with this

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,633
    If you are already storing the start and end times in the table, I would not also store the elapsed time, since that can be derived from the start/end fields. If you feel you do need to store it for any reason, then my first thought would be to just have it be an integer, where its value would probably be the number of seconds (or a float or decimal type if you want to include fractional parts of seconds).
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Mar 2010
    Posts
    281
    okay thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles