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

    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
    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).
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #3
    Join Date
    Mar 2010
    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