Hi there, does anybody knows how to define a variable which is an hour in epidata? Like 23:10.
Thanks for your help,
Hi there, does anybody knows how to define a variable which is an hour in epidata? Like 23:10.
Thanks for your help,
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:
atime after entry if (atime > 23.59) or (atime < 0) or ((atime -int(atime))>0.59) then help "Time @atime is invalid." goto atime endif end end
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@lists.umanitoba.ca wrote:
Hi there, does anybody knows how to define a variable which is an hour in epidata? Like 23:10.
participants (1)
-
epidata-list@lists.umanitoba.ca