Re: [Q] SQL: datetime
Posted in 1993
>From: uunet!rnihd.rni.sub.org!klaus (Klaus Brand) >Subject: [Q] SQL: datetime >Date: Tue, 23 Mar 1993 16:23:12 GMT >X-Informix-List-Id: <news.2883> >I have defined a table with two entries of the type "datetime" with the >precision "hour to fraction(5)". If i am setting the fields with i.e. >"current hour to fraction(5)" the fraction has the value "00000". Is the >precision of the fraction os-dependent or have I forgot to do something ?? The precision available in the fraction part af a DATETIME value is system dependent because there is no generic mechanism on Unix for getting sub-second time information. The nearest approach is the system call times(2), which gives an answer in clock ticks, typically either 1/60 or 1/100 of second. Some machines (notably RS6000) have finer resolution timers -- the RS6000 reports a time in nano-seconds, which is great. (OK, I don't trust the last three decimal places, because I don't know which microcode instruction reads the time value, but the principle is great -- provide a good high resolution timer, and let the programmer use as much of the precision as is relevant to them). As an aside, I don't know why 5 is the maximum precision for a DATETIME value; it seems silly not to use either milliseconds (3) or, better, microseconds (6). It isn't a limitation of the underlying decimal type. Yours, Jonathan Leffler (johnl@obelix.informix.com) #include <disclaimer.h>