Kun wrote:
> Fredrik Lundh wrote:
>> "Kun" wrote:
>>
>>> I have a python-cgi file that pulls data from an sql database, i am
>>> wondering what is the easiest way to remove all instances of
>>> '00:00:00.00' in my date column.
>>>
>>> how would i write a python script to scan the entire page and de
[EMAIL PROTECTED] wrote:
>
>Kun> assuming that my date column is 2, how would i parse out the date?
>
> No parsing required. Just get its date:
>
>d = record[2].date()
>
> The str() of a datetime.date object is a string in -MM-DD form.
or, in other words, change:
for col in range
Kun> assuming that my date column is 2, how would i parse out the date?
No parsing required. Just get its date:
d = record[2].date()
The str() of a datetime.date object is a string in -MM-DD form.
Kun> the example you gave is of you parsing out the current time, but
Kun> h
Tim Chase wrote:
>> for col in range(0, numcols):
>> print "", record[col], ""
>
> This is the point at which you want to intercept the column data and
> make your change:
>
> print "", str(record[col]).replace("00:00:00.0", ""), "
> If it's possible/plausible that other fie
[EMAIL PROTECTED] wrote:
> 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
> for col in range(0, numcols):
> print "", record[col], ""
This is the point at which you want to intercept the column
data and make your change:
print "", str(record[col]).replace("00:00:00.0", ""), "%s" % foo
or alternatively
DATECOLUMNS = [3, 14]
for col
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:
>>> impor
Fredrik Lundh wrote:
> "Kun" wrote:
>
>> because in my sql database, the date is only 'date' (as in -mm-dd),
>> only when i extract it with my python-cgi does the date turn into
>> (-mm-dd 00:00:00.00), thus i figured the best way to fix this
>> problem is to parse it after the matter.
>
"Kun" wrote:
> because in my sql database, the date is only 'date' (as in -mm-dd),
> only when i extract it with my python-cgi does the date turn into
> (-mm-dd 00:00:00.00), thus i figured the best way to fix this
> problem is to parse it after the matter.
you still make no sense. why n
Fredrik Lundh wrote:
> "Kun" wrote:
>
>> I have a python-cgi file that pulls data from an sql database, i am
>> wondering what is the easiest way to remove all instances of
>> '00:00:00.00' in my date column.
>>
>> how would i write a python script to scan the entire page and delete all
>> instanc
"Kun" wrote:
> I have a python-cgi file that pulls data from an sql database, i am
> wondering what is the easiest way to remove all instances of
> '00:00:00.00' in my date column.
>
> how would i write a python script to scan the entire page and delete all
> instances of '00:00:00.00', would i us
Kun wrote:
> I have a python-cgi file that pulls data from an sql database, i am
> wondering what is the easiest way to remove all instances of
> '00:00:00.00' in my date column.
>
> how would i write a python script to scan the entire page and delete all
> instances of '00:00:00.00', would i use
> I have a python-cgi file that pulls data from an sql
> database, i am wondering what is the easiest way to
> remove all instances of '00:00:00.00' in my date column.
>
> how would i write a python script to scan the entire page
> and delete all instances of '00:00:00.00', would i use
> regular e
I have a python-cgi file that pulls data from an sql database, i am
wondering what is the easiest way to remove all instances of
'00:00:00.00' in my date column.
how would i write a python script to scan the entire page and delete all
instances of '00:00:00.00', would i use regular expressions?
14 matches
Mail list logo