A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-February/019847.html below:

add basic time type to the standard library

[Python-Dev] proposal: add basic time type to the standard libraryFredrik Lundh fredrik@pythonware.com
Fri, 8 Feb 2002 19:04:45 +0100
I propose adding a basic time type (or time base type ;-) to the standard
library, which can be subclassed by more elaborate date/time/timestamp
implementations, such as mxDateTime, custom types provided by DB-API
drivers, etc.

The goal is to make it easy to extract the year, month, day, hour, minute,
and second from any given time object.

Or to put it another way, I want the following to work for any time object,
including mxDateTime objects, any date/timestamp returned by a DB-API
driver, and weird date/time-like types I've developed myself:

    if isinstance(t, basetime):
        # yay! it's a timestamp
        print t.timetuple()

The goal is not to standardize any behaviour beyond this; anything else
should be provided by subtypes.

More details here:

    http://effbot.org/ideas/time-type.htm

I can produce PEP and patch if necessary.

</F>




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4