time not date, date not time

Hi guys   we are trying to figure out a way to manage time and date. our main entity has the date, but has 1:*  to time.   easy right … except that when sorting on time, it also sorts on the date, what is best practise regarding this? I'd love to just not have to deal with date when managing times, or other way around.   what do you guys do? when handling times, just set date to a default date; 2000, 01, 01 for instance?
2 answers

I’d set the date to a fixed value for the entity holding the times.

As the date is counting from 1-1-1970 maybe use that for the times then the data in the db will only hold the seconds or ms from 0.Then sort on the times.



Hi Jason,

As your time is always respective with associated date entity value, you can calculate the time value as suggested by Erwin in time attribute. To add to it, I would also consider timezone settings during implementation and showing these values on pages as time is crucial part here.


Also make sure of testing edge cases to check time values when timeline spans to next day.