scanning through page and replacing all instances of 00:00:00.00

skip at pobox.com skip at pobox.com
Mon Apr 17 19:20:29 EDT 2006


    Kun> i have the following python-cgi which extracts data from a mysql
    Kun> table, how do i parse the date so that it doesn't display the time
    Kun> '00:00:00.00'?

I have no idea which column in your table is a datetime object, but just
convert it to a date.  For example:

    >>> import datetime
    >>> dt = datetime.datetime.now()
    >>> print dt
    2006-04-17 18:19:38.698925
    >>> print dt.date()
    2006-04-17

Skip



More information about the Python-list mailing list