Intelligent Date & Time parsing

castironpi at gmail.com castironpi at gmail.com
Mon Mar 10 06:30:22 CET 2008


On Mar 8, 12:57 pm, Tim Chase <python.l... at tim.thechases.com> wrote:
> > I am a GNU newbie.  (I know C &o.)  Can you point me to a
> > place to find the source for 'date'?
>
> It's part of the GNU Coreutils:
>
> http://ftp.gnu.org/gnu/coreutils/
>
> Within the file, you're likely interested in lib/getdate.*
>
> It helps if you have a working knowledge of Yacc.
>
> -tkc

Ah excellent.  I am looking at the part with:

static table const meridian_table[] =
{
  { "AM",   tMERIDIAN, MERam },
...
  { "JANUARY",	tMONTH,	 1 },
  { "FEBRUARY",	tMONTH,	 2 },
...
  { "YEAR",	tYEAR_UNIT,	 1 },
  { "MONTH",	tMONTH_UNIT,	 1 },

(where is 'lunar month'? ;) )

How do you like it?  Certainly Python cleans it up by a multiple, but
what about the rest?



More information about the Python-list mailing list