Re: To go from a datetime to an integer number of seconds...
Posted in 1996
select ('1/1/2000'-today)*24*60*60 from anytable will give you the number of seconds left till your program crashes :) In article <553712$9rm@news.informix.com>, proberts@lynx.informix.com (Paul Roberts) writes: > > Is there a function available in I-SQL or I-4GL which will convert > a datetime into an integer, that integer being the number of seconds > between the datetime and some specific instant? > > i.e., in the same way that: > > select date_stamp - '1/1/1900' > from some_table > > will get me "how many days have passed since 1/1/1900?", how do I find > out how many seconds have passed since some arbitrary "beginning of time"? > > There's probably some painfully obvious answer to this, but datetime > arithmetic always confuses me, and it is a Monday morning (almost)... > > - Paul > > ************************************************************************* > Disclaimer: All opinions expressed in this message are well-reasoned and > insightful; needless to say, they are not those of Informix Software, its > partners or lackeys. Anyone who says otherwise is itching for a fight. > > -- ---------------------------------------------------------------------- David Paulo, InForm Group Ltd.,PO Box 1444, Wellington, New Zealand. Ph: +64 4 472 0996 Fax: +64 4 473 2407 Email: david@inform.co.nz = What would you do if you knew that you could not fail = ----------------------------------------------------------------------