Jump to content

Time Field for Durations?


This topic is 2254 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I need to create a 'Duration' field for a Table of movies to enter the Hours / Mins / Seconds.   The 'Time' Field type seems to be designed for time of day, not a length of time, and it seems like it could be used for my purposes here, since no film would be longer than 24 hours.  Since the Time field is stored a numerical value of seconds, it would seem to 'behave' as I'd want it too, and I could use calculations to render the time in minutes or hours and minutes as needed.

But is this a 'best practice'?  Am I overlooking some potential unintended and unwanted consequences using a Time Field for Duration as opposed to time of day?   Something that will come back to haunt me?  if so, what is the alternative -- creating 3 fields for Hr/Min/Sec and manipulating them as needed?

 

Link to comment
Share on other sites

32 minutes ago, Wickerman said:

The 'Time' Field type seems to be designed for time of day,

No, it is perfectly suitable for durations as well.

33 minutes ago, Wickerman said:

it seems like it could be used for my purposes here, since no film would be longer than 24 hours.

There's no problem with using a Time field for storing durations that exceed 24 hours either.

34 minutes ago, Wickerman said:

But is this a 'best practice'?

That depends on your situation, but in general I would say yes. But keep in mind that entering times is not as straightforward as entering dates, for example.

 

Link to comment
Share on other sites

This topic is 2254 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.