[EpiData-list] Time and time differences - recording of time variables

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Fri Nov 27 16:15:35 CST 2009

Time is frequently used in food-borne outbreak investigations (especially in
cohort studies). Time in hours would normally be more important than hours
and minutes. Seconds would never be used.

If time is only in hours, no special field is required; just make ## and
allow only 0-24.
For hours and minutes, the format ##:## or ##.## or ##h## (French) should be
allowed, with the separator specified as for date, decimal or thousands

Functions that handle ##.## times or just ## times would result in
fractional days.

e.g. onset = onsetdate + time2day(onsettime) // results in fractional day
that could be formatted for output as yyyy/mm/dd hh:mm or some similar
arrangement. In the case of intervals, could format as ### days ##:##

e.g. start = time2day(starttime)  // where starttime is ##:## results in
fraction of a day: 0.xxxxx
e.g. interval = time2day(finishtime) - time2day(starttime) // results in
fraction like xx.xxxxx days where finishtime and starttime are date+fraction
date fields (or as far as EpiData knows are simply real numbers.

In outbreaks, time is most useful when constructing epicurves or determining
incubation times. Handling date/time in epicurves will be very useful, where
the grouping of times into regular intervals (n hours, n days, n weeks,
months) would be welcome.

Jamie Hockin

2009/11/25 <epidata-list at lists.umanitoba.ca>

> As part of current development there is an issue of how time is best
> represented in data.
> Recent years have added a date-time field to some database systems. In
> most cases for entry these are rather cumbersome to work with in practice
> in my experience.
> The suggestion is to add one time field:
> hh.mm.ss        that is a time field with 6 digits.
> examples:
> Entered             recorded
> 1            01.00.00   (one o'clock at night)
> 122        12.20.00   (20 minutes past twelwe)
> 182045   18.20.45   (20 minutes,45 seconds after 18 hours)
> Functions will be needed e.g. to calculate time in hours, minutes or
> seconds from day1 time1 to day2 time2. Or conversion of an imported
> date-time value to separate the date into one field and the time into
> another.
> Users are encouraged to give examples and discuss here on the list
> regarding:
> a. Needs for recording of time
> b. Examples of practical situations where this was needed
> c. In what format would users prefer recording.
> Also whether there seems to be a need for a combined date-time field.
> regards
> Jens Lauritsen
> EpiData Association

More information about the EpiData-list mailing list