[EpiData-list] Defining hours

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Tue Jul 27 14:56:08 CDT 2010

EpiData Entry lets you define time as a real value of the form ##.##
Although it has functions that deal with time (see help file under Checks for descriptions of the functions num2time and time2num), it does not validate the values at the time of entry. 
You can do this yourself:

 after entry
  if (atime > 23.59) or (atime < 0) or ((atime -int(atime))>0.59) then
   help "Time @atime is invalid."
   goto atime

To check the differences between two times, first convert them to a value between 0 and 1 representing the fraction of a day.

tdiff = time2num(atime) - time2num(btime)  // will give time difference as fraction of a day; if negative, add 1
vtdiff = num2time(tdiff)    // will give time difference as hh.mm

Jamie Hockin

On 2010-07-27, at 12:42 PM, epidata-list at lists.umanitoba.ca wrote:

> Hi there, does anybody knows how to define a variable which is an hour in
> epidata? Like 23:10.

More information about the EpiData-list mailing list