kak@hico2.UUCP (Kris A. Kugel) (03/18/91)
I recently saw a mention of an improved version of the "getdate" routine. (The article disappeared in a semi-daily emergency disk clean). I want to use a routine like this for general usage. I've got the 1986 one, and either I'm using it wrong, or it can't read date(1) format dates, which limits its usefulness. Does anybody have new/current info on this? Kris A. Kugel ( 908 ) 842-2707 uunet!tsdiag.ccur.com!hico2!kak {daver,ditka,zorch}!hico2!kak internet: kak@hico2.westmark.com
ts@uwasa.fi (Timo Salmi) (03/18/91)
In article <1272@hico2.UUCP> kak@hico2.westmark.com writes: >I recently saw a mention of an improved version of the "getdate" >routine. (The article disappeared in a semi-daily emergency : If you first elaborate what the improved getdate routine is expected to do, there would be a better change of trying to find a useful answer. ................................................................... Prof. Timo Salmi Moderating at garbo.uwasa.fi anonymous ftp archives 128.214.12.37 School of Business Studies, University of Vaasa, SF-65101, Finland Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun
woods@eci386.uucp (Greg A. Woods) (03/23/91)
In article <1991Mar18.141630.9094@uwasa.fi> ts@uwasa.fi (Timo Salmi) writes: > In article <1272@hico2.UUCP> kak@hico2.westmark.com writes: > >I recently saw a mention of an improved version of the "getdate" > >routine. (The article disappeared in a semi-daily emergency > > If you first elaborate what the improved getdate routine is expected > to do, there would be a better change of trying to find a useful > answer. I think 'kak' did -- the version available wouldn't eat date(1) output. The version of getdate that is shipped with C News works fine. It even is available as a shell callable programme. In addition I have a version of date(1) that is almost POSIX 1003.2-draft compatible. However, my version will take getdate output (rather than the current system date) via the command line and convert it back to the given ASCII representation. I think I remember posting this to alt.sources. It's not ready for comp.sources yet though, since it's not a complete POSIX implementation. -- Greg A. Woods woods@{eci386,gate,robohack,ontmoh,tmsoft}.UUCP ECI and UniForum Canada +1-416-443-1734 [h] +1-416-595-5425 [w] VE3TCP Toronto, Ontario CANADA Political speech and writing are largely the defense of the indefensible-ORWELL
moraes@cs.toronto.edu (Mark Moraes) (03/23/91)
In comp.sources.wanted you write: >I recently saw a mention of an improved version of the "getdate" >routine. (The article disappeared in a semi-daily emergency >disk clean). I want to use a routine like this for general usage. >I've got the 1986 one, and either I'm using it wrong, >or it can't read date(1) format dates, which limits its usefulness. The latest set of patches to C News include a general date parser that will, among other things, parse date(1) format. Also a very fast RFC822/1123 date parser. Even the general date parser is considerably faster than getdate (a factor of 3 to 4). (If size is a concern to you, it's also somewhat smaller) You can get just the date parsing package (with a small test program and a simple regression test) as pub/libdate.shar.Z from ftp.cs.toronto.edu. The second part of the 3-part C News patch being posted this week (<1991Mar20.224941.19240@zoo.toronto.edu> in news.software.b, pub/c-news/patches/17-Mar-1991 on ftp.cs.toronto.edu) also contains all the relevant files and manual pages if you already have C News. Please remember to wait for the next part before recompiling C News! Once the current C patch is complete, pub/libc.c-news.shar.Z (the programming workbench no-one should leave home without!) will be updated to contain this stuff. The files you need are: libc/dateconv.c libc/dateconv.h libc/datetok.c libc/datetok.h libc/getabsdate.3 libc/getabsdate.c libc/getindate.c libc/qmktime.c libc/split.3 libc/split.c People running System V will need libusg/ftime.c hfake/sys/timeb.h They're all standalone and don't require other parts of the C News distribution. Other features of getabsdate: + does not accept all-numeric dates. Yes, this is a feature -- it avoids the irritating ambiguities (1/2/90) which will only get worse when 2000 rolls around (1/2/3?) + has an interface to return a struct tm with the parsed components instead of a time_t. + has a simple rule for avoiding ambiguities between two digit years and days -- the day must come first. Otherwise, it is far less rigid than getdate since it imposes no other ordering, and will ignore weird text, assuming it to be unknown timezones. + more complete timezone info. [It has been pointed out that the timezone table has several obsolete zones and some errors -- to be fixed in the next C News patch] + isn't written in yacc, doesn't use lex. + will parse C News patchfile names and DEC dates :-) One shortcoming: it lacks a relative date parser. [getreldate() will hopefully be ready in time for the next C News patch] Mark.