Path: utzoo!attcan!uunet!munnari!murtoa.cs.mu.oz.au!ditmela!yarra!melba!gnb From: gnb@melba.bby.oz (Gregory N. Bond) Newsgroups: comp.databases Subject: Ingres ESQL/C & Unix date formats Message-ID: <42@melba.oz> Date: 15 Nov 88 00:17:21 GMT Reply-To: gnb@melba.oz.au (Gregory Bond) Organization: Burdett, Buckeridge & Young Ltd, Melbourne Lines: 22 I'm trying to use embedded SQL from C, calling the ingres database to extract and process data. The problem I'm having is converting Ingres dates to unix time(3)-style dates (i.e. #secs since 1/1/70). Ingres insists on considering dates as 26 character strings. The best solution I can find is something like select int4(interval('secs', date_col - date('1/1/70'))) from .... which almost seems to work, but problems with timezones seem to make this unreliable (we just went on to DST here...) as Ingres is converting the '1/1/70' to local time.... Not to mention SLOW. date('') doesn't work, nor does int4(date_col). What do others use here? Greg. P.S. Why the &^%&^*&^ doesn't ingres have a substring operator??????? -- Gregory Bond, Burdett Buckeridge & Young Ltd, Melbourne, Australia Internet: gnb@melba.bby.oz.au non-MX: gnb%melba.bby.oz@uunet.uu.net Uucp: {uunet,mnetor,pyramid,ucb-vision,ukc..}!munnari!melba.bby.oz!gnb