Date manipulation and Java 'interface' equivalents

Dan Kuchler kuchler at ajubasolutions.com
Sun Nov 5 08:53:06 EST 2000


Martin Christensen wrote:
> 
> Howdy,
> 
> There are two matters for which I would like clarification.
> 
> First of all, I am doing some statistics with a PostgreSQL database,
> and for this I need to manipulate some dates, ie. add a week to this
> date or subtract a month from another. I didn't find any obvious
> candidates for this kind of date math in the library reference. Now,
> _of course_ this can be done in Python rather than forcing me to use
> the DBMS for this, but... erm... how?

This is one thing that tcl does extremely well
(in my opinion).  You should take a look at the
'clock' command in the tcl manual pages at:

http://dev.scriptics.com/man/

If anyone is really intersested, the code that implements the
'clock format' and 'clock scan' functionality is mostly isolated
in the tcl/generic/tclGetDate.y, tcl/generic/tclDate.c, and
tcl/generic/tclClock.c source files.

The command is quite powerful and very useful, although
the formats recognized are not localized to the specified
locale.

--Dan



More information about the Python-list mailing list